use of org.pac4j.oidc.credentials.extractor.OidcExtractor in project pac4j by pac4j.
the class OidcClient method clientInit.
@Override
protected void clientInit() {
CommonHelper.assertNotNull("configuration", configuration);
configuration.init();
defaultRedirectActionBuilder(new OidcRedirectActionBuilder(configuration, this));
defaultCredentialsExtractor(new OidcExtractor(configuration, this));
defaultAuthenticator(new OidcAuthenticator(configuration, this));
defaultProfileCreator(new OidcProfileCreator<>(configuration));
defaultLogoutActionBuilder(new OidcLogoutActionBuilder<U>(configuration));
}
use of org.pac4j.oidc.credentials.extractor.OidcExtractor in project ddf by codice.
the class OidcHandler method getCredentialsFromRequest.
private OidcCredentials getCredentialsFromRequest(OidcClient<OidcConfiguration> oidcClient, JEEContext jeeContext) {
// Check that the request contains a code, an access token or an id token
Map<String, String[]> requestParams = jeeContext.getRequestParameters();
if (!requestParams.containsKey("code") && !requestParams.containsKey("access_token") && !requestParams.containsKey("id_token")) {
return new OidcCredentials();
}
oidcClient.setCallbackUrlResolver(new QueryParameterCallbackUrlResolver());
OidcExtractor oidcExtractor = new OidcExtractor(oidcClient.getConfiguration(), oidcClient);
return oidcExtractor.extract(jeeContext).orElse(null);
}
Aggregations