public class AzureADGraphClient extends Object
| Modifier and Type | Field and Description |
|---|---|
private List<String> |
aadTargetGroups |
private String |
clientId |
private String |
clientSecret |
private static String |
DEFAULE_ROLE_PREFIX |
private static org.springframework.security.core.authority.SimpleGrantedAuthority |
DEFAULT_AUTHORITY |
private static String |
REQUEST_ID_SUFFIX |
private ServiceEndpoints |
serviceEndpoints |
| Constructor and Description |
|---|
AzureADGraphClient(com.microsoft.aad.adal4j.ClientCredential clientCredential,
AADAuthenticationProperties aadAuthProps,
ServiceEndpointsProperties serviceEndpointsProps) |
| Modifier and Type | Method and Description |
|---|---|
com.microsoft.aad.adal4j.AuthenticationResult |
acquireTokenForGraphApi(String idToken,
String tenantId) |
Set<org.springframework.security.core.GrantedAuthority> |
convertGroupsToGrantedAuthorities(List<UserGroup> groups)
Converts UserGroup list to Set of GrantedAutorities
|
private static String |
getCorrelationId() |
Set<org.springframework.security.core.GrantedAuthority> |
getGrantedAuthorities(String graphApiToken) |
List<UserGroup> |
getGroups(String graphApiToken) |
private static String |
getResponseStringFromConn(HttpURLConnection conn) |
private String |
getUserMembershipsV1(String accessToken) |
private List<UserGroup> |
loadUserGroups(String graphApiToken) |
private static final org.springframework.security.core.authority.SimpleGrantedAuthority DEFAULT_AUTHORITY
private static final String DEFAULE_ROLE_PREFIX
private static final String REQUEST_ID_SUFFIX
private String clientId
private String clientSecret
private ServiceEndpoints serviceEndpoints
public AzureADGraphClient(com.microsoft.aad.adal4j.ClientCredential clientCredential,
AADAuthenticationProperties aadAuthProps,
ServiceEndpointsProperties serviceEndpointsProps)
private String getUserMembershipsV1(String accessToken) throws IOException
IOExceptionprivate static String getResponseStringFromConn(HttpURLConnection conn) throws IOException
IOExceptionpublic List<UserGroup> getGroups(String graphApiToken) throws IOException
IOExceptionprivate List<UserGroup> loadUserGroups(String graphApiToken) throws IOException
IOExceptionpublic Set<org.springframework.security.core.GrantedAuthority> getGrantedAuthorities(String graphApiToken) throws IOException
IOExceptionpublic Set<org.springframework.security.core.GrantedAuthority> convertGroupsToGrantedAuthorities(List<UserGroup> groups)
groups - public com.microsoft.aad.adal4j.AuthenticationResult acquireTokenForGraphApi(String idToken, String tenantId) throws MalformedURLException, ServiceUnavailableException, InterruptedException, ExecutionException
private static String getCorrelationId()
Copyright © 2019 Microsoft. All rights reserved.