public class UserPrincipalManager extends Object
| Constructor and Description |
|---|
UserPrincipalManager(com.nimbusds.jose.jwk.source.JWKSource<com.nimbusds.jose.proc.SecurityContext> keySource)
ø
Creates a new
UserPrincipalManager with a predefined JWKSource. |
UserPrincipalManager(ServiceEndpointsProperties serviceEndpointsProps,
AADAuthenticationProperties aadAuthProps,
com.nimbusds.jose.util.ResourceRetriever resourceRetriever,
boolean explicitAudienceCheck)
Create a new
UserPrincipalManager based of the ServiceEndpoints.getAadKeyDiscoveryUri() and
AADAuthenticationProperties.getEnvironment(). |
UserPrincipalManager(ServiceEndpointsProperties serviceEndpointsProps,
AADAuthenticationProperties aadAuthProps,
com.nimbusds.jose.util.ResourceRetriever resourceRetriever,
boolean explicitAudienceCheck,
com.nimbusds.jose.jwk.source.JWKSetCache jwkSetCache)
Create a new
UserPrincipalManager based of the ServiceEndpoints.getAadKeyDiscoveryUri() and
AADAuthenticationProperties.getEnvironment(). |
| Modifier and Type | Method and Description |
|---|---|
UserPrincipal |
buildUserPrincipal(String idToken) |
boolean |
isTokenIssuedByAAD(String token) |
public UserPrincipalManager(com.nimbusds.jose.jwk.source.JWKSource<com.nimbusds.jose.proc.SecurityContext> keySource)
UserPrincipalManager with a predefined JWKSource.
This is helpful in cases the JWK is not a remote JWKSet or for unit testing.
keySource - - JWKSource containing at least one keypublic UserPrincipalManager(ServiceEndpointsProperties serviceEndpointsProps, AADAuthenticationProperties aadAuthProps, com.nimbusds.jose.util.ResourceRetriever resourceRetriever, boolean explicitAudienceCheck)
UserPrincipalManager based of the ServiceEndpoints.getAadKeyDiscoveryUri() and
AADAuthenticationProperties.getEnvironment().serviceEndpointsProps - - used to retrieve the JWKS URLaadAuthProps - - used to retrieve the environment.resourceRetriever - - configures the RemoteJWKSet call.explicitAudienceCheck - - explicit audience checkpublic UserPrincipalManager(ServiceEndpointsProperties serviceEndpointsProps, AADAuthenticationProperties aadAuthProps, com.nimbusds.jose.util.ResourceRetriever resourceRetriever, boolean explicitAudienceCheck, com.nimbusds.jose.jwk.source.JWKSetCache jwkSetCache)
UserPrincipalManager based of the ServiceEndpoints.getAadKeyDiscoveryUri() and
AADAuthenticationProperties.getEnvironment().serviceEndpointsProps - - used to retrieve the JWKS URLaadAuthProps - - used to retrieve the environment.resourceRetriever - - configures the RemoteJWKSet call.jwkSetCache - - used to cache the JWK set for a finite time, default set to 5 minutes
which matches constructor above if no jwkSetCache is passed inexplicitAudienceCheck - - explicit audience checkpublic UserPrincipal buildUserPrincipal(String idToken) throws ParseException, com.nimbusds.jose.JOSEException, com.nimbusds.jose.proc.BadJOSEException
ParseExceptioncom.nimbusds.jose.JOSEExceptioncom.nimbusds.jose.proc.BadJOSEExceptionpublic boolean isTokenIssuedByAAD(String token)
Copyright © 2020 Microsoft Corporation. All rights reserved.