Identityserver4: Requesting access token with multiple scopes

Created on 2 Feb 2018  路  2Comments  路  Source: IdentityServer/IdentityServer4

The 'RequestClientCredentialsAsync' TokenClient extension only allows a token to be requested for a single scope. What is the reasoning for this? Is there a way to request a token that contains multiple scopes? I thought this would be possible by passing a dictionary to the 'extra' parameter containing a { "scope", "scope_name" } pair, however, this did not work. Any insight? If this is not possible - I would like to understand why.

Most helpful comment

Okay, I have found the solution. It _is_ possible.

You can pass multiple scope names to the 'scope' parameter. Each scope needs to be separated by a space. For example:

await tokenClient.RequestClientCredentialsAsync("scope1 scope2");

All 2 comments

Okay, I have found the solution. It _is_ possible.

You can pass multiple scope names to the 'scope' parameter. Each scope needs to be separated by a space. For example:

await tokenClient.RequestClientCredentialsAsync("scope1 scope2");

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings