/** * Issuer of the SAML token * * @return */ @Override public String getIssuerName() { return assertion.getIssuer(); }
/** {@inheritDoc} */ protected void processElementContent(XMLObject samlObject, String elementContent) { StatusMessage statusMessage = (StatusMessage) samlObject; statusMessage.setMessage(elementContent); } }
/** {@inheritDoc} */ protected void processElementContent(XMLObject samlObject, String elementContent) { NameIdentifier nameIdentifier = (NameIdentifier) samlObject; nameIdentifier.setNameIdentifier(elementContent); } }
private Conditions newConditions(final DateTime issuedAt, final String serviceId) { final Conditions conditions = newSamlObject(Conditions.class); conditions.setNotBefore(issuedAt); conditions.setNotOnOrAfter(issuedAt.plus(this.issueLength)); final AudienceRestrictionCondition audienceRestriction = newSamlObject(AudienceRestrictionCondition.class); final Audience audience = newSamlObject(Audience.class); audience.setUri(serviceId); audienceRestriction.getAudiences().add(audience); conditions.getAudienceRestrictionConditions().add(audienceRestriction); return conditions; }
private Subject newSubject(final String identifier) { final SubjectConfirmation confirmation = newSamlObject(SubjectConfirmation.class); final ConfirmationMethod method = newSamlObject(ConfirmationMethod.class); method.setConfirmationMethod(CONFIRMATION_METHOD); confirmation.getConfirmationMethods().add(method); final NameIdentifier nameIdentifier = newSamlObject(NameIdentifier.class); nameIdentifier.setNameIdentifier(identifier); final Subject subject = newSamlObject(Subject.class); subject.setNameIdentifier(nameIdentifier); subject.setSubjectConfirmation(confirmation); return subject; }
protected void validateDoNotCache(Assertion assertion) throws ValidationException { if (assertion.getMinorVersion() == 0) { Conditions conditions = assertion.getConditions(); if (conditions != null) { for (Condition condition : conditions.getConditions()) { if (condition instanceof DoNotCacheCondition) { throw new ValidationException("DoNotCacheCondition not valid in SAML1.0"); } } } } } }
protected final Status newStatus(final QName codeValue, final String statusMessage) { final Status status = newSamlObject(Status.class); final StatusCode code = newSamlObject(StatusCode.class); code.setValue(codeValue); status.setStatusCode(code); if (statusMessage != null) { final StatusMessage message = newSamlObject(StatusMessage.class); message.setMessage(statusMessage); status.setStatusMessage(message); } return status; }
/** {@inheritDoc} */ protected void processElementContent(XMLObject samlObject, String elementContent) { ConfirmationMethod confirmationMethod = (ConfirmationMethod) samlObject; confirmationMethod.setConfirmationMethod(elementContent); } }
/** {@inheritDoc} */ protected void processElementContent(XMLObject samlObject, String elementContent) { Audience audience = (Audience) samlObject; audience.setUri(elementContent); } }
/** * @return the SAML signature. */ @Override public Signature getSAMLSignature() { return assertion.getSignature(); }
/** {@inheritDoc} */ protected void marshallAttributes(XMLObject samlElement, Element domElement) throws MarshallingException { AttributeDesignator designator = (AttributeDesignator) samlElement; if (designator.getAttributeName() != null) { domElement.setAttributeNS(null, AttributeDesignator.ATTRIBUTENAME_ATTRIB_NAME, designator .getAttributeName()); } if (designator.getAttributeNamespace() != null) { domElement.setAttributeNS(null, AttributeDesignator.ATTRIBUTENAMESPACE_ATTRIB_NAME, designator .getAttributeNamespace()); } }
/** {@inheritDoc} */ protected void processElementContent(XMLObject samlObject, String elementContent) { Action action = (Action) samlObject; action.setContents(elementContent); } }
/** {@inheritDoc} */ protected void marshallAttributes(XMLObject samlElement, Element domElement) throws MarshallingException { AuthorizationDecisionStatement authorizationDecisionStatement; authorizationDecisionStatement = (AuthorizationDecisionStatement) samlElement; if (authorizationDecisionStatement.getResource() != null) { domElement.setAttributeNS(null, AuthorizationDecisionStatement.RESOURCE_ATTRIB_NAME, authorizationDecisionStatement.getResource()); } if (authorizationDecisionStatement.getDecision() != null) { domElement.setAttributeNS(null, AuthorizationDecisionStatement.DECISION_ATTRIB_NAME, authorizationDecisionStatement.getDecision().toString()); } } }
@Override public OMElement getAssertionElement() throws TrustException { return (OMElement)this.assertion.getDOM(); }
/** {@inheritDoc} */ protected void processElementContent(XMLObject samlObject, String elementContent) { AssertionIDReference assertionIDReference = (AssertionIDReference) samlObject; assertionIDReference.setReference(elementContent); } }
/** {@inheritDoc} */ protected void processElementContent(XMLObject samlObject, String elementContent) { AssertionArtifact assertionArtifact = (AssertionArtifact) samlObject; assertionArtifact.setAssertionArtifact(elementContent); } }
/** * {@inheritDoc} */ protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject) throws UnmarshallingException { StatusDetail statusDetail = (StatusDetail) parentSAMLObject; statusDetail.getUnknownXMLObjects().add(childSAMLObject); } }
/** {@inheritDoc} */ protected void marshallElementContent(XMLObject samlObject, Element domElement) throws MarshallingException { Action action = (Action) samlObject; if (action.getContents() != null) { XMLHelper.appendTextContent(domElement, action.getContents()); } } }
/** {@inheritDoc} */ protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject) throws UnmarshallingException { SubjectQuery query = (SubjectQuery) parentSAMLObject; if (childSAMLObject instanceof Subject) { query.setSubject((Subject) childSAMLObject); } else { super.processChildElement(parentSAMLObject, childSAMLObject); } }
/** {@inheritDoc} */ protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject) throws UnmarshallingException { StatusCode statusCode = (StatusCode) parentSAMLObject; if (childSAMLObject instanceof StatusCode) { statusCode.setStatusCode((StatusCode) childSAMLObject); } else { super.processChildElement(parentSAMLObject, childSAMLObject); } }