Class AzureAd2Client

java.lang.Object
org.pac4j.core.util.InitializableObject
org.pac4j.core.client.BaseClient
org.pac4j.core.client.IndirectClient
org.pac4j.oidc.client.OidcClient
org.pac4j.oidc.client.AzureAd2Client
All Implemented Interfaces:
org.pac4j.core.client.Client

public class AzureAd2Client extends OidcClient

This class is the OpenID Connect client to authenticate users in Microsoft Azure AD v2.

.

More information at: https://docs.microsoft.com/azure/active-directory/develop/active-directory-v2-protocols

Since:
5.0.0
Author:
Charley Wu
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected com.fasterxml.jackson.databind.ObjectMapper
     
    protected static final com.fasterxml.jackson.core.type.TypeReference<HashMap<String,Object>>
     

    Fields inherited from class org.pac4j.core.client.IndirectClient

    ATTEMPTED_AUTHENTICATION_SUFFIX, callbackUrl, callbackUrlResolver, urlResolver

    Fields inherited from class org.pac4j.core.client.BaseClient

    logger, saveProfileInSession
  • Constructor Summary

    Constructors
    Constructor
    Description
     
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Refresh the access token
    protected void
    internalInit(boolean forceReinit)
     
    protected org.pac4j.core.http.callback.CallbackUrlResolver
     

    Methods inherited from class org.pac4j.oidc.client.OidcClient

    beforeInternalInit, notifySessionRenewal, renewUserProfile

    Methods inherited from class org.pac4j.core.client.IndirectClient

    afterInternalInit, computeFinalCallbackUrl, defaultLogoutActionBuilder, defaultRedirectionActionBuilder, getAjaxRequestResolver, getCallbackUrl, getCallbackUrlResolver, getCodeVerifierSessionAttributeName, getCredentials, getLogoutAction, getLogoutActionBuilder, getNonceSessionAttributeName, getRedirectionAction, getRedirectionActionBuilder, getStateSessionAttributeName, getUrlResolver, isCheckAuthenticationAttempt, setAjaxRequestResolver, setCallbackUrl, setCallbackUrlResolver, setCheckAuthenticationAttempt, setLogoutActionBuilder, setRedirectionActionBuilder, setUrlResolver, toString

    Methods inherited from class org.pac4j.core.client.BaseClient

    addAuthorizationGenerator, addAuthorizationGenerators, defaultAuthenticator, defaultCredentialsExtractor, defaultProfileCreator, getAuthenticator, getAuthorizationGenerators, getCredentialsExtractor, getCustomProperties, getLogger, getName, getProfileCreator, getProfileFactoryWhenNotAuthenticated, getSaveProfileInSession, getSaveProfileInSession, getUserProfile, isMultiProfile, isMultiProfile, retrieveCredentials, retrieveUserProfile, setAuthenticator, setAuthorizationGenerator, setAuthorizationGenerators, setAuthorizationGenerators, setCredentialsExtractor, setCustomProperties, setMultiProfile, setName, setProfileCreator, setProfileFactoryWhenNotAuthenticated, setSaveProfileInSession

    Methods inherited from class org.pac4j.core.util.InitializableObject

    getInitialized, getLastAttempt, getMaxAttempts, getMinTimeIntervalBetweenAttemptsInMilliseconds, getNbAttempts, init, init, isInitialized, reinit, setMaxAttempts, setMinTimeIntervalBetweenAttemptsInMilliseconds, shouldInitialize

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • objectMapper

      protected com.fasterxml.jackson.databind.ObjectMapper objectMapper
    • typeRef

      protected static final com.fasterxml.jackson.core.type.TypeReference<HashMap<String,Object>> typeRef
  • Constructor Details

  • Method Details

    • internalInit

      protected void internalInit(boolean forceReinit)
      Overrides:
      internalInit in class OidcClient
    • newDefaultCallbackUrlResolver

      protected org.pac4j.core.http.callback.CallbackUrlResolver newDefaultCallbackUrlResolver()
      Overrides:
      newDefaultCallbackUrlResolver in class org.pac4j.core.client.IndirectClient
    • getAccessTokenFromRefreshToken

      public String getAccessTokenFromRefreshToken(AzureAdProfile azureAdProfile)

      Refresh the access token

      https://docs.microsoft.com/azure/active-directory/develop/v2-oauth2-auth-code-flow#refresh-the-access-token