SAML2TokenState.java revision e6d7ebe1d98f7f030969e521b061f8643253475e
/*
* The contents of this file are subject to the terms of the Common Development and
* Distribution License (the License). You may not use this file except in compliance with the
* License.
*
* You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
* specific language governing permission and limitations under the License.
*
* When distributing Covered Software, include this CDDL Header Notice in each file and include
* the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions Copyrighted [year] [name of copyright owner]".
*
* Copyright 2014 ForgeRock AS. All rights reserved.
*/
/**
* This class encapsulates state passed to the REST STS about the nature of the to-be-issued SAML2 token. The
* REST-STS, in turn, passes some of this information to the TokenGenerationService.
*/
public class SAML2TokenState {
public static class SAML2TokenStateBuilder {
private ProofTokenState proofTokenState;
public SAML2TokenStateBuilder saml2SubjectConfirmation(SAML2SubjectConfirmation subjectConfirmation) {
return this;
}
this.proofTokenState = proofTokenState;
return this;
}
return this;
}
return new SAML2TokenState(this);
}
}
/*
These variables are public so that hand-rolled JsonValues corresponding to SAML2TokenState can be created.
*/
private final SAML2SubjectConfirmation subjectConfirmation;
private final ProofTokenState proofTokenState;
if (subjectConfirmation == null) {
throw new TokenMarshalException(ResourceException.BAD_REQUEST, "SubjectConfirmation type must be set.");
}
if (SAML2SubjectConfirmation.HOLDER_OF_KEY.equals(subjectConfirmation) && (proofTokenState == null)) {
}
/*
See section 4.1.4.2 of http://docs.oasis-open.org/security/saml/v2.0/saml-profiles-2.0-os.pdf: for a Bearer assertion,
the Recipient attribute of the SubjectConfirmationData must contain the Service Provider Assertion Consumer Service
Url.
*/
SAML2SubjectConfirmation.BEARER + " is specified, the serviceProviderAssertionConsumerServiceUrl must also be set.");
}
}
public static SAML2TokenStateBuilder builder() {
return new SAML2TokenStateBuilder();
}
public SAML2SubjectConfirmation getSubjectConfirmation() {
return subjectConfirmation;
}
public ProofTokenState getProofTokenState() {
return proofTokenState;
}
return spAcsUrl;
}
if (subjectConfirmationString == null) {
}
try {
} catch (IllegalArgumentException e) {
throw new TokenMarshalException(ResourceException.BAD_REQUEST, "Invalid subject confirmation type specified.");
}
if (!jsonProofToken.isNull()) {
}
}
if (proofTokenState != null) {
} else {
}
}
}
public int hashCode() {
}
if (other instanceof SAML2TokenState) {
spAcsUrl != null ? spAcsUrl.equals(otherTokenState.getServiceProviderAssertionConsumerServiceUrl()) :
}
return false;
}
}