package org.pac4j.oidc.profile.azuread;

import com.nimbusds.jose.JWSAlgorithm;
import com.nimbusds.oauth2.sdk.id.ClientID;
import com.nimbusds.openid.connect.sdk.validators.IDTokenValidator;
import org.pac4j.oidc.client.azuread.AzureAdIdTokenValidator;
import org.pac4j.oidc.config.OidcConfiguration;
import org.pac4j.oidc.profile.creator.OidcProfileCreator;

/**
 * Specific profile creator for Azure.
 *
 * @author Jerome Leleu
 * @since 1.9.2
 */
public class AzureAdProfileCreator extends OidcProfileCreator<AzureAdProfile> {

    public AzureAdProfileCreator(final OidcConfiguration configuration) {
        super(configuration);
        setProfileFactory(() -> new AzureAdProfile());
    }

    @Override
    protected IDTokenValidator createRSATokenValidator(final JWSAlgorithm jwsAlgorithm, final ClientID clientID) {
        return new AzureAdIdTokenValidator(super.createRSATokenValidator(jwsAlgorithm, clientID));
    }
}

@@ -177,32 +177,74 @@
 TokenValidator;%0A
+import org.pac4j.core.context.WebContext;%0A
 import org.pac4j
@@ -671,16 +671,97 @@
 ation);%0A
+    %7D%0A%0A    @Override%0A    protected void internalInit(final WebContext context) %7B%0A
         
@@ -803,24 +803,61 @@
 Profile());%0A
+        super.internalInit(context);%0A
     %7D%0A%0A    @

refactor profile type definition in AzureAdProfileCreator