Search in sources :

Example 1 with ParameterExtractor

use of org.pac4j.core.credentials.extractor.ParameterExtractor in project pac4j by pac4j.

the class ParameterClient method clientInit.

@Override
protected void clientInit() {
    CommonHelper.assertNotBlank("parameterName", this.parameterName);
    defaultCredentialsExtractor(new ParameterExtractor(this.parameterName, this.supportGetRequest, this.supportPostRequest));
}
Also used : ParameterExtractor(org.pac4j.core.credentials.extractor.ParameterExtractor)

Example 2 with ParameterExtractor

use of org.pac4j.core.credentials.extractor.ParameterExtractor in project pac4j by pac4j.

the class DirectCasClient method clientInit.

@Override
protected void clientInit() {
    CommonHelper.assertNotNull("urlResolver", this.urlResolver);
    CommonHelper.assertNotNull("callbackUrlResolver", this.callbackUrlResolver);
    CommonHelper.assertNotNull("configuration", this.configuration);
    CommonHelper.assertTrue(!configuration.isGateway(), "the DirectCasClient can not support gateway to avoid infinite loops");
    defaultCredentialsExtractor(new ParameterExtractor(CasConfiguration.TICKET_PARAMETER, true, false));
    // only a fake one for the initialization as we will build a new one with the current url for each request
    super.defaultAuthenticator(new CasAuthenticator(configuration, getName(), urlResolver, callbackUrlResolver, "fake"));
    addAuthorizationGenerator(new DefaultCasAuthorizationGenerator<>());
}
Also used : ParameterExtractor(org.pac4j.core.credentials.extractor.ParameterExtractor) CasAuthenticator(org.pac4j.cas.credentials.authenticator.CasAuthenticator)

Example 3 with ParameterExtractor

use of org.pac4j.core.credentials.extractor.ParameterExtractor in project pac4j by pac4j.

the class DirectCasProxyClient method clientInit.

@Override
protected void clientInit() {
    CommonHelper.assertNotNull("urlResolver", this.urlResolver);
    CommonHelper.assertNotNull("callbackUrlResolver", this.callbackUrlResolver);
    CommonHelper.assertNotBlank("serviceUrl", this.serviceUrl);
    CommonHelper.assertNotNull("configuration", this.configuration);
    // must be a CAS proxy protocol
    final CasProtocol protocol = configuration.getProtocol();
    CommonHelper.assertTrue(protocol == CasProtocol.CAS20_PROXY || protocol == CasProtocol.CAS30_PROXY, "The DirectCasProxyClient must be configured with a CAS proxy protocol (CAS20_PROXY or CAS30_PROXY)");
    defaultCredentialsExtractor(new ParameterExtractor(CasConfiguration.TICKET_PARAMETER, true, false));
    defaultAuthenticator(new CasAuthenticator(configuration, getName(), urlResolver, callbackUrlResolver, this.serviceUrl));
    addAuthorizationGenerator(new DefaultCasAuthorizationGenerator<>());
}
Also used : ParameterExtractor(org.pac4j.core.credentials.extractor.ParameterExtractor) CasAuthenticator(org.pac4j.cas.credentials.authenticator.CasAuthenticator) CasProtocol(org.pac4j.cas.config.CasProtocol)

Aggregations

ParameterExtractor (org.pac4j.core.credentials.extractor.ParameterExtractor)3 CasAuthenticator (org.pac4j.cas.credentials.authenticator.CasAuthenticator)2 CasProtocol (org.pac4j.cas.config.CasProtocol)1