Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scope of token request #36

Open
kylebridgford opened this issue Aug 27, 2020 · 0 comments
Open

Scope of token request #36

kylebridgford opened this issue Aug 27, 2020 · 0 comments

Comments

@kylebridgford
Copy link

kylebridgford commented Aug 27, 2020

It appears that the app is using the v1.0 endpoint for the implicit grant:

public const string RoleSettingsAadPropertyName = "IdentitySource";
public const string RoleSettingsAadPropertyValue = "Azure";
private const string TokenEndpointPattern = "https://login.microsoftonline.com/{0}/oauth2/token";
private const string LogoutEndpointPattern =
"https://login.microsoftonline.com/{0}/oauth2/logout?post_logout_redirect_uri={1}";
private const string AuthorizationEndpointPattern = "https://login.microsoftonline.com/{0}/oauth2/authorize";
private const string GraphEndpointPattern = "https://graph.windows.net/{0}";
private static readonly ILog Logger = LoggerSource.Instance.GetLogger(typeof(AzureClient));
private GraphClient _graphClient;
private GraphClient GraphClient

When building the query params, scope is defined:

new QueryParameter("scope", Scope),
new QueryParameter("client_id", APIKey),
new QueryParameter("redirect_uri", HttpContext.Current.Server.UrlEncode(CallbackUri.ToString())),
new QueryParameter("state", HttpContext.Current.Server.UrlEncode(new State() {
PortalId = Settings.PortalID,
Culture = PortalSettings.Current.CultureCode
}.ToString())),
new QueryParameter("response_type", "code"),
new QueryParameter("response_mode", "query"),

However, according to the microsoft docs for the v1 endpoint, scope is ignored, and you should instead use resource. Without the resource on the v1 endpoint, you are going to get the default graph JWT tokens, not the ones defined in the app manifest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant