A small and simple task, but which took me a lot of time searching the web. So now I know where to find it. Disclaimer we will be using the Password Grant Flow you can find details here , in the link its discouraged to use this flow except maybe on legacy applications. That aside. Identity Server 4 Set up you identity server to use the password grant as indicated in their documentation, you can find link here . C# Code var client = new HttpClient(); client.BaseAddress = new Uri("http://localhost:5000"); var byteArray = Encoding.Default.GetBytes("ro.client:secret"); client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Convert.ToBase64String(byteArray)); var request = new HttpRequestMessage(HttpMethod.Post, "/connect/token"); ...
I (Alvin Vafana Microsoft Certified Solutions Developer (MCSD)). Talks about my journey as a developer and offer solutions to challenges i faced