I have implemented an authorization server in a Asp.Net Web Api project as explained in this article.
Now I need to consume the service from a .Net c# client. In the IdentityModel documentation I can see below example:
var client = new TokenClient(
"https://server/token",
"client_id",
"secret");
var response = await client.RequestClientCredentialsAsync("scope");
var token = response.AccessToken;
Questions:
- What is the purpose of having client Id and a client secret?
- How a user will be authenticated using user credentials?
- How can I access the user claims in client side?
- What is
Scope
and what is the use of it?
By
using IdentityModel.Client;
the token can be consumed in following way.in the
token
itself contains claim properties.