Skip to content

Commit

Permalink
Remove deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
leleuj committed Dec 12, 2018
1 parent c42479d commit 1ccb372
Show file tree
Hide file tree
Showing 13 changed files with 8 additions and 154 deletions.
11 changes: 0 additions & 11 deletions pac4j-cas/src/main/java/org/pac4j/cas/logout/CasLogoutHandler.java

This file was deleted.

This file was deleted.

Expand Up @@ -34,7 +34,7 @@ && isNotBlank(keystorePath) && isNotBlank(identityProviderMetadataPath)) {
final String maximumAuthenticationLifetime = getProperty(SAML_MAXIMUM_AUTHENTICATION_LIFETIME, i);
final String serviceProviderEntityId = getProperty(SAML_SERVICE_PROVIDER_ENTITY_ID, i);
final String serviceProviderMetadataPath = getProperty(SAML_SERVICE_PROVIDER_METADATA_PATH, i);
final String destinationBindingType = getProperty(SAML_DESTINATION_BINDING_TYPE, i);
final String destinationBindingType = getProperty(SAML_AUTHN_REQUEST_BINDING_TYPE, i);
final String keystoreAlias = getProperty(SAML_KEYSTORE_ALIAS, i);

final SAML2Configuration cfg = new SAML2Configuration(keystorePath, keystorePassword,
Expand All @@ -49,7 +49,7 @@ && isNotBlank(keystorePath) && isNotBlank(identityProviderMetadataPath)) {
cfg.setServiceProviderMetadataPath(serviceProviderMetadataPath);
}
if (isNotBlank(destinationBindingType)) {
cfg.setDestinationBindingType(destinationBindingType);
cfg.setAuthnRequestBindingType(destinationBindingType);
}
if (isNotBlank(keystoreAlias)) {
cfg.setKeystoreAlias(keystoreAlias);
Expand Down
Expand Up @@ -50,7 +50,7 @@ public interface PropertiesConstants {
String SAML_MAXIMUM_AUTHENTICATION_LIFETIME = "saml.maximumAuthenticationLifetime";
String SAML_SERVICE_PROVIDER_ENTITY_ID = "saml.serviceProviderEntityId";
String SAML_SERVICE_PROVIDER_METADATA_PATH = "saml.serviceProviderMetadataPath";
String SAML_DESTINATION_BINDING_TYPE = "saml.destinationBindingType";
String SAML_AUTHN_REQUEST_BINDING_TYPE = "saml.authnRequestBindingType";
String SAML_KEYSTORE_ALIAS = "saml.keystoreAlias";

String CAS_LOGIN_URL = "cas.loginUrl";
Expand Down
Expand Up @@ -55,7 +55,7 @@ public void test() {
properties.put(SAML_PRIVATE_KEY_PASSWORD, PASSWORD);
properties.put(SAML_KEYSTORE_PATH, PATH);
properties.put(SAML_IDENTITY_PROVIDER_METADATA_PATH, PATH);
properties.put(SAML_DESTINATION_BINDING_TYPE, SAMLConstants.SAML2_REDIRECT_BINDING_URI);
properties.put(SAML_AUTHN_REQUEST_BINDING_TYPE, SAMLConstants.SAML2_REDIRECT_BINDING_URI);
properties.put(SAML_KEYSTORE_ALIAS, VALUE);
properties.put(OIDC_ID, ID);
properties.put(OIDC_SECRET, SECRET);
Expand Down Expand Up @@ -137,7 +137,7 @@ public void test() {
final SAML2Client saml2client = (SAML2Client) clients.findClient("SAML2Client");
assertNotNull(saml2client);
final SAML2Configuration saml2Config = saml2client.getConfiguration();
assertEquals(SAMLConstants.SAML2_REDIRECT_BINDING_URI, saml2Config.getDestinationBindingType());
assertEquals(SAMLConstants.SAML2_REDIRECT_BINDING_URI, saml2Config.getAuthnRequestBindingType());
assertEquals(VALUE, saml2Config.getKeyStoreAlias());

final OidcClient oidcClient = (OidcClient) clients.findClient("OidcClient");
Expand Down
Expand Up @@ -68,16 +68,6 @@ public FacebookConfiguration getConfiguration() {
return (FacebookConfiguration) configuration;
}

@Deprecated
public void setStateData(final String stateData) {
configuration.setStateData(stateData);
}

@Deprecated
public String getStateData() {
return configuration.getStateData();
}

public String getScope() {
return getConfiguration().getScope();
}
Expand Down
Expand Up @@ -56,16 +56,6 @@ public void setWithState(final boolean withState) {
this.withState = withState;
}

@Deprecated
public String getStateData() {
return ((StaticOrRandomStateGenerator) stateGenerator).getStateData();
}

@Deprecated
public void setStateData(final String stateData) {
((StaticOrRandomStateGenerator) stateGenerator).setStateData(stateData);
}

public StateGenerator getStateGenerator() {
return stateGenerator;
}
Expand Down
Expand Up @@ -3,6 +3,7 @@
import org.junit.Test;
import org.pac4j.core.context.MockWebContext;
import org.pac4j.core.exception.TechnicalException;
import org.pac4j.core.state.StaticOrRandomStateGenerator;
import org.pac4j.core.util.CommonHelper;
import org.pac4j.core.util.TestsConstants;
import org.pac4j.core.util.TestsHelper;
Expand Down Expand Up @@ -34,7 +35,7 @@ private OAuth20Client getClient() {
public void testState() throws MalformedURLException {
FacebookClient client = new FacebookClient(KEY, SECRET);
client.setCallbackUrl(CALLBACK_URL);
client.setStateData("OK");
((StaticOrRandomStateGenerator) client.getConfiguration().getStateGenerator()).setStateData("OK");
URL url = new URL(client.getRedirectAction(MockWebContext.create()).getLocation());
assertTrue(url.getQuery().contains("state=OK"));
}
Expand All @@ -43,7 +44,7 @@ public void testState() throws MalformedURLException {
public void testSetState() throws MalformedURLException {
FacebookClient client = new FacebookClient(KEY, SECRET);
client.setCallbackUrl(CALLBACK_URL);
client.setStateData("oldstate");
((StaticOrRandomStateGenerator) client.getConfiguration().getStateGenerator()).setStateData("oldstate");
final MockWebContext mockWebContext = MockWebContext.create();
URL url = new URL(client.getRedirectAction(mockWebContext).getLocation());
final Map<String, String> stringMap = splitQuery(url);
Expand Down
Expand Up @@ -316,16 +316,6 @@ public void setWithState(final boolean withState) {
this.withState = withState;
}

@Deprecated
public String getStateData() {
return ((StaticOrRandomStateGenerator) stateGenerator).getStateData();
}

@Deprecated
public void setStateData(final String stateData) {
((StaticOrRandomStateGenerator) stateGenerator).setStateData(stateData);
}

public boolean isExpireSessionWithToken() {
return expireSessionWithToken;
}
Expand Down
10 changes: 0 additions & 10 deletions pac4j-saml/src/main/java/org/pac4j/saml/client/SAML2Client.java
Expand Up @@ -95,11 +95,6 @@ public SAML2Client(final SAML2Configuration configuration) {
this.configuration = configuration;
}

@Deprecated
public SAML2Client(final SAML2ClientConfiguration configuration) {
this.configuration = configuration;
}

@Override
protected void clientInit() {
CommonHelper.assertNotNull("configuration", this.configuration);
Expand Down Expand Up @@ -223,11 +218,6 @@ public SAML2ResponseValidator getAuthnResponseValidator() {
return this.authnResponseValidator;
}

@Deprecated
public final SAML2ResponseValidator getResponseValidator() {
return this.authnResponseValidator;
}

public final SAML2MetadataResolver getServiceProviderMetadataResolver() {
return this.spMetadataResolver;
}
Expand Down

This file was deleted.

Expand Up @@ -415,26 +415,6 @@ public void setComparisonType(final String comparisonType) {
this.comparisonType = comparisonType;
}

/**
* Use {@link #getAuthnRequestBindingType()}.
*
* @return the authn request binding type
*/
@Deprecated
public String getDestinationBindingType() {
return getAuthnRequestBindingType();
}

/**
* Use {@link #setAuthnRequestBindingType(String)}.
*
* @param destinationBindingType the authn request binding type
*/
@Deprecated
public void setDestinationBindingType(final String destinationBindingType) {
setAuthnRequestBindingType(destinationBindingType);
}

public String getAuthnRequestBindingType() {
return authnRequestBindingType;
}
Expand Down
Expand Up @@ -70,9 +70,6 @@ public void validate(final SAML2Credentials credentials, final WebContext contex
final SAML2Credentials.SAMLNameID nameId = credentials.getNameId();
profile.setId(nameId.getValue());

// @Deprecated: the session index is an authentication attribute, not a user one: to be removed
profile.addAttribute(SESSION_INDEX, credentials.getSessionIndex());

profile.addAuthenticationAttribute(SESSION_INDEX, credentials.getSessionIndex());
profile.addAuthenticationAttribute(SAML_NAME_ID_FORMAT, nameId.getFormat());
profile.addAuthenticationAttribute(SAML_NAME_ID_NAME_QUALIFIER, nameId.getNameQualifier());
Expand Down

0 comments on commit 1ccb372

Please sign in to comment.