Package org.picketlink.identity.federation.saml.v2.assertion

Examples of org.picketlink.identity.federation.saml.v2.assertion.AudienceRestrictionType


    */
   private void issueToken(WSTrustRequestContext context, String assertionID) throws WSTrustException
   {
      // lifetime and audience restrictions.
      Lifetime lifetime = context.getRequestSecurityToken().getLifetime();
      AudienceRestrictionType restriction = null;
      AppliesTo appliesTo = context.getRequestSecurityToken().getAppliesTo();
      if (appliesTo != null)
         restriction = SAMLAssertionFactory.createAudienceRestriction(WSTrustUtil.parseAppliesTo(appliesTo));
      ConditionsType conditions = SAMLAssertionFactory.createConditions(lifetime.getCreated(), lifetime.getExpires(),
            restriction);
View Full Code Here


    * @param values a {@code String[]} containing the restriction values.
    * @return the constructed {@code AudienceRestrictionType} instance.
    */
   public static AudienceRestrictionType createAudienceRestriction(String... values)
   {
      AudienceRestrictionType audienceRestriction = new AudienceRestrictionType();
      if (values != null)
         audienceRestriction.getAudience().addAll(Arrays.asList(values));
      return audienceRestriction;
   }
View Full Code Here

      // generate an id for the new assertion.
      String assertionID = IDGenerator.create("ID_");

      // lifetime and audience restrictions.
      Lifetime lifetime = context.getRequestSecurityToken().getLifetime();
      AudienceRestrictionType restriction = null;
      AppliesTo appliesTo = context.getRequestSecurityToken().getAppliesTo();
      if (appliesTo != null)
         restriction = SAMLAssertionFactory.createAudienceRestriction(WSTrustUtil.parseAppliesTo(appliesTo));
      ConditionsType conditions = SAMLAssertionFactory.createConditions(lifetime.getCreated(), lifetime.getExpires(),
            restriction);
View Full Code Here

    */
   private void issueToken(WSTrustRequestContext context, String assertionID) throws WSTrustException
   {
      // lifetime and audience restrictions.
      Lifetime lifetime = context.getRequestSecurityToken().getLifetime();
      AudienceRestrictionType restriction = null;
      AppliesTo appliesTo = context.getRequestSecurityToken().getAppliesTo();
      if (appliesTo != null)
         restriction = SAMLAssertionFactory.createAudienceRestriction(WSTrustUtil.parseAppliesTo(appliesTo));
      ConditionsType conditions = SAMLAssertionFactory.createConditions(lifetime.getCreated(), lifetime.getExpires(),
            restriction);
View Full Code Here

    * @param values a {@code String[]} containing the restriction values.
    * @return the constructed {@code AudienceRestrictionType} instance.
    */
   public static AudienceRestrictionType createAudienceRestriction(String... values)
   {
      AudienceRestrictionType audienceRestriction = new AudienceRestrictionType();
      if (values != null)
         audienceRestriction.getAudience().addAll(Arrays.asList(values));
      return audienceRestriction;
   }
View Full Code Here

    * @param values a {@code String[]} containing the restriction values.
    * @return the constructed {@code AudienceRestrictionType} instance.
    */
   public static AudienceRestrictionType createAudienceRestriction(String... values)
   {
      AudienceRestrictionType audienceRestriction = new AudienceRestrictionType();
      if (values != null)
         audienceRestriction.getAudience().addAll(Arrays.asList(values));
      return audienceRestriction;
   }
View Full Code Here

        subjectConfirmationData.setNotOnOrAfter(SamlUtils.getXMLGregorianCalendarNowPlusDuration(GregorianCalendar.MINUTE, ASSERTION_VALIDITY_IN_MINUTES));
        subjectConfirmationData.setInResponseTo(samlDialogue.get().getExternalProviderMessageId());

        ConditionsType conditions = assertionObjectFactory.createConditionsType();
        assertion.setConditions(conditions);
        AudienceRestrictionType audienceRestriction = assertionObjectFactory.createAudienceRestrictionType();
        conditions.getConditionOrAudienceRestrictionOrOneTimeUse().add(audienceRestriction);
        audienceRestriction.getAudience().add(samlDialogue.get().getExternalProvider().getEntityId());

        AuthnStatementType authnStatement = assertionObjectFactory.createAuthnStatementType();
        assertion.getStatementOrAuthnStatementOrAuthzDecisionStatement().add(authnStatement);
        authnStatement.setAuthnInstant(SamlUtils.getXMLGregorianCalendarNow());
        authnStatement.setSessionIndex(((SamlIdpSessionImpl) session).getSessionIndex());
View Full Code Here

      subjectConfirmationData.setNotOnOrAfter(SamlUtils.getXMLGregorianCalendarNowPlusDuration(GregorianCalendar.MINUTE, ASSERTION_VALIDITY_IN_MINUTES));
      subjectConfirmationData.setInResponseTo(samlDialogue.get().getExternalProviderMessageId());

      ConditionsType conditions = assertionObjectFactory.createConditionsType();
      assertion.setConditions(conditions);
      AudienceRestrictionType audienceRestriction = assertionObjectFactory.createAudienceRestrictionType();
      conditions.getConditionOrAudienceRestrictionOrOneTimeUse().add(audienceRestriction);
      audienceRestriction.getAudience().add(samlDialogue.get().getExternalProvider().getEntityId());

      AuthnStatementType authnStatement = assertionObjectFactory.createAuthnStatementType();
      assertion.getStatementOrAuthnStatementOrAuthzDecisionStatement().add(authnStatement);
      authnStatement.setAuthnInstant(SamlUtils.getXMLGregorianCalendarNow());
      authnStatement.setSessionIndex(((SamlIdpSessionImpl) session).getSessionIndex());
View Full Code Here

                event.event(EventType.LOGIN);
                event.error(Errors.INVALID_TOKEN);
                return Flows.forwardToSecurityFailurePage(session, realm, uriInfo, "Invalid Request");
            }

            SAML2Object samlObject = documentHolder.getSamlObject();

            RequestAbstractType requestAbstractType = (RequestAbstractType)samlObject;
            String issuer = requestAbstractType.getIssuer().getValue();
            ClientModel client = realm.findClient(issuer);
View Full Code Here

        sp.setRequestID(requestID);
        sp.setIssuer(requestIssuer);
        responseType = saml2Response.createResponseType(id, sp, idp, issuerHolder);

        // Add information on the roles
        AssertionType assertion = responseType.getAssertions().get(0).getAssertion();

        // Create an AuthnStatementType
        if (!disableAuthnStatement) {
            String authContextRef = JBossSAMLURIConstants.AC_UNSPECIFIED.get();
            if (isNotNull(authMethod))
                authContextRef = authMethod;

            AuthnStatementType authnStatement = StatementUtil.createAuthnStatement(XMLTimeUtil.getIssueInstant(),
                    authContextRef);

            authnStatement.setSessionIndex(assertion.getID());

            assertion.addStatement(authnStatement);
        }

        if (roles != null && !roles.isEmpty()) {
            AttributeStatementType attrStatement = StatementUtil.createAttributeStatementForRoles(roles, multiValuedRoles);
            assertion.addStatement(attrStatement);
        }

        // Add in the attributes information
        if (attributes != null && attributes.size() > 0) {
            AttributeStatementType attStatement = StatementUtil.createAttributeStatement(attributes);
            assertion.addStatement(attStatement);
        }

        try {
            samlResponseDocument = saml2Response.convert(responseType);
View Full Code Here

TOP

Related Classes of org.picketlink.identity.federation.saml.v2.assertion.AudienceRestrictionType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.