Using HTTP to get a token from IdentityServer 4.
This is part 2, part 1 can be found here . IdentityServer's token endpoint expects to receive content as application/x-www-form-urlencoded. Note: if you wish to view the request and response in fiddler use localhost.fiddler Create a console application select .Net Core as the type. Optionally add a class if you want to deserialize the data to an Object. public class RootObject { public String access_token { get; set; } public String expires_in { get; set; } public String token_type { get; set; } } Example 1 using WebClient Create a NameValueCollection var body = new NameValueCollection() { { "client_id", "client" }, {"client_secret", "secret" }, {"grant_type", "client_credentials" }, {"scope", "api...