Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,17 @@ public void clientRegistered() {
assertEquals("fake-client-secret", azure.getClientSecret());

AuthorizationServerEndpoints endpoints = new AuthorizationServerEndpoints();
assertEquals(endpoints.authorizationEndpoint("fake-tenant-id"), azure.getProviderDetails().getAuthorizationUri());
assertEquals(endpoints.authorizationEndpoint("fake-tenant-id"),
azure.getProviderDetails().getAuthorizationUri());
assertEquals(endpoints.tokenEndpoint("fake-tenant-id"), azure.getProviderDetails().getTokenUri());
assertEquals(endpoints.jwkSetEndpoint("fake-tenant-id"), azure.getProviderDetails().getJwkSetUri());
assertEquals("{baseUrl}/login/oauth2/code/{registrationId}", azure.getRedirectUriTemplate());
assertDefaultScopes(azure, "openid", "profile");
assertDefaultScopes(
azure,
"openid",
"profile",
"https://graph.microsoft.com/Directory.AccessAsUser.All",
"https://graph.microsoft.com/User.Read");
}
}

Expand All @@ -50,7 +56,14 @@ public void clientRequiresPermissionRegistered() {
ClientRegistration graph = repo.findByRegistrationId("graph");

assertNotNull(azure);
assertDefaultScopes(azure, "openid", "profile", "offline_access", "Calendars.Read");
assertDefaultScopes(
azure,
"openid",
"profile",
"https://graph.microsoft.com/Directory.AccessAsUser.All",
"https://graph.microsoft.com/User.Read",
"offline_access",
"Calendars.Read");

assertNotNull(graph);
assertDefaultScopes(graph, "Calendars.Read");
Expand All @@ -73,6 +86,8 @@ public void clientRequiresMultiPermissions() {
azure,
"openid",
"profile",
"https://graph.microsoft.com/Directory.AccessAsUser.All",
"https://graph.microsoft.com/User.Read",
"offline_access",
"Calendars.Read",
"https://management.core.windows.net/user_impersonation");
Expand All @@ -92,7 +107,14 @@ public void clientRequiresPermissionInDefaultClient() {
ClientRegistration azure = repo.findByRegistrationId("azure");

assertNotNull(azure);
assertDefaultScopes(azure, "openid", "profile", "offline_access", "Calendars.Read");
assertDefaultScopes(
azure,
"openid",
"profile",
"https://graph.microsoft.com/Directory.AccessAsUser.All",
"https://graph.microsoft.com/User.Read",
"offline_access",
"Calendars.Read");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ private AzureClientRegistration createDefaultClient() {
}

private Set<String> allScopes() {
Set<String> result = openidScopes();
Set<String> result = accessTokenScopes();
for (AuthorizationProperties authProperties : properties.getAuthorization().values()) {
result.addAll(authProperties.getScopes());
}
Expand Down