public class AzureADGraphClient extends Object
| Constructor and Description |
|---|
AzureADGraphClient(String clientId,
String clientSecret,
AADAuthenticationProperties aadAuthenticationProperties,
AADAuthorizationServerEndpoints endpoints) |
| Modifier and Type | Method and Description |
|---|---|
com.microsoft.aad.msal4j.IAuthenticationResult |
acquireTokenForGraphApi(String idToken,
String tenantId)
Acquire access token for calling Graph API.
|
Set<String> |
getGroups(String graphApiToken) |
Set<org.springframework.security.core.authority.SimpleGrantedAuthority> |
toGrantedAuthoritySet(Set<String> groups) |
public AzureADGraphClient(String clientId, String clientSecret, AADAuthenticationProperties aadAuthenticationProperties, AADAuthorizationServerEndpoints endpoints)
public Set<String> getGroups(String graphApiToken) throws IOException
graphApiToken - token used to access graph api.IOException - throw exception if get groups failed by IOException.public Set<org.springframework.security.core.authority.SimpleGrantedAuthority> toGrantedAuthoritySet(Set<String> groups)
public com.microsoft.aad.msal4j.IAuthenticationResult acquireTokenForGraphApi(String idToken, String tenantId) throws ServiceUnavailableException
idToken - The token used to perform an OBO request.tenantId - The tenant id.ServiceUnavailableException - If fail to acquire the token.com.microsoft.aad.msal4j.MsalServiceException - If MsalServiceException has occurred.Visit the Azure for Java Developers site for more Java documentation, including quick starts, tutorials, and code samples.