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

Examples of org.picketlink.identity.federation.saml.v2.metadata.IDPSSODescriptorType


         builder.append("ID=").append(rdt.getID());
         builder.append(LINE_SEPARATOR);
        
         if(rdt instanceof IDPSSODescriptorType)
         {
            IDPSSODescriptorType idp = (IDPSSODescriptorType) rdt;
            builder.append(toString(idp));
         }
         if(rdt instanceof SPSSODescriptorType)
         {
            SPSSODescriptorType sp = (SPSSODescriptorType) rdt;
View Full Code Here


         EndpointType ssoEndPoint,
         EndpointType sloEndPoint,
         List<AttributeType> attributes,
         OrganizationType org)
   {
      IDPSSODescriptorType idp = oFact.createIDPSSODescriptorType();
      idp.getSingleSignOnService().add(ssoEndPoint);
      idp.getSingleLogoutService().add(sloEndPoint);
      idp.getAttribute().addAll(attributes);
      idp.getKeyDescriptor().add(keyDescriptorType);
      idp.setWantAuthnRequestsSigned(requestsSigned);
      idp.setOrganization(org);
      return idp;
   }
View Full Code Here

    }

    public SamlExternalIdentityProvider addExternalSamlEntity(Reader reader) {
        EntityDescriptorType entityDescriptor = readEntityDescriptor(reader);
        String entityId = entityDescriptor.getEntityID();
        IDPSSODescriptorType IDPSSODescriptor = (IDPSSODescriptorType) entityDescriptor.getRoleDescriptorOrIDPSSODescriptorOrSPSSODescriptor().get(0);
        return addExternalIdentityProvider(entityId, IDPSSODescriptor);
    }
View Full Code Here

            IndexedEndpointType ssoPostEndpoint = metaDataFactory.createIndexedEndpointType();
            ssoPostEndpoint.setBinding(SamlConstants.HTTP_POST_BINDING);
            ssoPostEndpoint.setLocation(getServiceURL(SamlServiceType.SAML_SINGLE_SIGN_ON_SERVICE));

            IDPSSODescriptorType idpSsoDescriptor = metaDataFactory.createIDPSSODescriptorType();

            idpSsoDescriptor.getSingleSignOnService().add(ssoRedirectEndpoint);
            idpSsoDescriptor.getSingleSignOnService().add(ssoPostEndpoint);
            addSloEndpointsToMetaData(idpSsoDescriptor);

            idpSsoDescriptor.setWantAuthnRequestsSigned(isWantAuthnRequestsSigned());

            idpSsoDescriptor.getProtocolSupportEnumeration().add(SamlConstants.PROTOCOL_NSURI);

            addNameIDFormatsToMetaData(idpSsoDescriptor);

            addKeyDescriptorToMetaData(idpSsoDescriptor);
View Full Code Here

         IndexedEndpointType ssoPostEndpoint = metaDataFactory.createIndexedEndpointType();
         ssoPostEndpoint.setBinding(SamlConstants.HTTP_POST_BINDING);
         ssoPostEndpoint.setLocation(getServiceURL(SamlServiceType.SAML_SINGLE_SIGN_ON_SERVICE));

         IDPSSODescriptorType idpSsoDescriptor = metaDataFactory.createIDPSSODescriptorType();

         idpSsoDescriptor.getSingleSignOnService().add(ssoRedirectEndpoint);
         idpSsoDescriptor.getSingleSignOnService().add(ssoPostEndpoint);
         addSloEndpointsToMetaData(idpSsoDescriptor);

         idpSsoDescriptor.setWantAuthnRequestsSigned(isWantAuthnRequestsSigned());

         idpSsoDescriptor.getProtocolSupportEnumeration().add(SamlConstants.PROTOCOL_NSURI);

         addNameIDFormatsToMetaData(idpSsoDescriptor);

         addKeyDescriptorToMetaData(idpSsoDescriptor);
View Full Code Here

   public SamlExternalIdentityProvider addExternalSamlEntity(Reader reader)
   {
      EntityDescriptorType entityDescriptor = readEntityDescriptor(reader);
      String entityId = entityDescriptor.getEntityID();
      IDPSSODescriptorType IDPSSODescriptor = (IDPSSODescriptorType) entityDescriptor.getRoleDescriptorOrIDPSSODescriptorOrSPSSODescriptor().get(0);
      return addExternalIdentityProvider(entityId, IDPSSODescriptor);
   }
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

            String assertionStr = samlCredential.getAssertionAsString();
            if (StringUtil.isNullOrEmpty(assertionStr))
                throw logger.authSAMLAssertionNullOrEmpty();

            SAMLParser parser = new SAMLParser();
            AssertionType assertion = (AssertionType) parser.parse(new ByteArrayInputStream(assertionStr.getBytes()));
            List<String> roles = AssertionUtil.getRoles(assertion, null);
            Group roleGroup = new SimpleGroup(SecurityConstants.ROLES_IDENTIFIER);
            for (String role : roles) {
                roleGroup.addMember(new SimplePrincipal(role));
            }
View Full Code Here

        }

        Map<String, Object> contextMap = new HashMap<String, Object>();
        contextMap.put(SHARED_TOKEN, this.samlToken);

        AssertionType assertion = null;
        try {
            assertion = SAMLUtil.fromElement(samlToken);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }

        if (principalMappingContext != null) {
            principalMappingContext.performMapping(contextMap, null);
            Principal principal = principalMappingContext.getMappingResult().getMappedObject();
            subject.getPrincipals().add(principal);

            // If the user has configured cache invalidation of subject based on saml token expiry
            if (enableCacheInvalidation) {
                TimeCacheExpiry cacheExpiry = JBossAuthCacheInvalidationFactory.getCacheExpiry();

                XMLGregorianCalendar expiry = AssertionUtil.getExpiration(assertion);
                if (expiry != null) {
                    cacheExpiry.register(securityDomain, expiry.toGregorianCalendar().getTime(), principal);
                } else {
                    logger.samlAssertionWithoutExpiration(assertion.getID());
                }
            }
        }

        if (roleMappingContext != null) {
View Full Code Here

TOP

Related Classes of org.picketlink.identity.federation.saml.v2.metadata.IDPSSODescriptorType

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.