Package org.opensaml.saml2.core.impl

Examples of org.opensaml.saml2.core.impl.NameIDBuilder


    public String getTokenId(Element token) {
        return token.getAttribute(Assertion.ID_ATTRIB_NAME);
    }

    private Subject createSubject(String username) {
        NameID nameID = (new NameIDBuilder()).buildObject();
        nameID.setValue(username);
        String format = "urn:oasis:names:tc:SAML:1.1:nameid-format:transient";
        if (format != null) {
            nameID.setFormat(format);
        }
View Full Code Here


        return subject;
    }

    private Subject createSubject(X509Certificate certificate) throws Exception {
        DefaultBootstrap.bootstrap();
        NameID nameID = (new NameIDBuilder()).buildObject();
        nameID.setValue(certificate.getSubjectDN().getName());
        String format = "urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName";
        if (format != null) {
            nameID.setFormat(format);
        }
View Full Code Here

        DateTime issueInstant = new DateTime();
        logoutReq.setIssueInstant(issueInstant);
        logoutReq.setNotOnOrAfter(new DateTime(issueInstant.getMillis() + 5 * 60 * 1000));

        NameID nameId = new NameIDBuilder().buildObject();
        nameId.setFormat(SAMLSSOConstants.NAME_ID_POLICY_ENTITY);
        nameId.setValue(subject);
        logoutReq.setNameID(nameId);

        SessionIndex sessionIndex = new SessionIndexBuilder().buildObject();
View Full Code Here

            samlAssertion.setVersion(SAMLVersion.VERSION_20);
            samlAssertion.setIssuer(SAMLSSOUtil.getIssuer());
            samlAssertion.setIssueInstant(currentTime);
            Subject subject = new SubjectBuilder().buildObject();

            NameID nameId = new NameIDBuilder().buildObject();
            if (authReqDTO.getUseFullyQualifiedUsernameAsSubject()) {
                nameId.setValue(authReqDTO.getUsername());
                nameId.setFormat(NameIdentifier.EMAIL);
            } else {
                nameId.setValue(UserCoreUtil.getTenantLessUsername(authReqDTO.getUsername()));
View Full Code Here

        IssuerBuilder issuerBuilder = new IssuerBuilder();
        Issuer issuer = issuerBuilder.buildObject();
        issuer.setValue(Util.getServiceProviderId());
        logoutReq.setIssuer(issuer);

        NameID nameId = new NameIDBuilder().buildObject();
        nameId.setFormat(SAML2SSOAuthenticatorConstants.SAML2_NAME_ID_POLICY_TRANSIENT);
        nameId.setValue(subject);
        logoutReq.setNameID(nameId);

        SessionIndex sessionIndex = new SessionIndexBuilder().buildObject();
View Full Code Here

        authnRequest.setIssueInstant(new DateTime());
        authnRequest.setIssuer(buildIssuer());
        authnRequest.setNameIDPolicy(buildNameIDPolicy());
        if (subjectName != null) {
            Subject subject = new SubjectBuilder().buildObject();
            NameID nameId = new NameIDBuilder().buildObject();
            nameId.setValue(subjectName);
            nameId.setFormat(NameIdentifier.EMAIL);
            subject.setNameID(nameId);
            authnRequest.setSubject(subject);
           
View Full Code Here

        else {
            try {
                String subjectNameId = data.getPrincipal().getName();

                //Create NameID and attach it to the subject
                NameIDBuilder nb = new NameIDBuilder();
                NameID nameID = nb.buildObject();
                nameID.setValue(subjectNameId);
                nameID.setFormat(NameIdentifier.EMAIL);
                subject.setNameID(nameID);

View Full Code Here

        request = createMock(HttpServletRequest.class);
        response = createMock(HttpServletResponse.class);

        authentication = createMock(Authentication.class);

        NameIDBuilder nameIDBuilder = new NameIDBuilder();
        AssertionBuilder assertionBuilder = new AssertionBuilder();
        List<Attribute> attrs = Collections.emptyList();

        credential = new SAMLCredential(
                nameIDBuilder.buildObject("uri:the-namespace", "localName", "prefix"),
                assertionBuilder.buildObject("uri:the-namespace", "localName", "prefix"),
                "remoteEntityID", "relayState", attrs, "localEntityID");

        redirectStrategy = createMock(RedirectStrategy.class);
View Full Code Here

        else if(data.getKeyType().endsWith(RahasConstants.KEY_TYPE_PUBLIC_KEY)){
            try {
                String subjectNameId = data.getPrincipal().getName();

                //Create NameID and attach it to the subject
                NameIDBuilder nb = new NameIDBuilder();
                NameID nameID = nb.buildObject();
                nameID.setValue(subjectNameId);
                nameID.setFormat(NameIdentifier.EMAIL);
                subject.setNameID(nameID);

View Full Code Here

        SAMLObjectBuilder<Subject> subjectBuilder =
                (SAMLObjectBuilder<Subject>) builderFactory.getBuilder(Subject.DEFAULT_ELEMENT_NAME);
        Subject subject = subjectBuilder.buildObject();

        //Create NameID and attach it to the subject
        NameID nameID = new NameIDBuilder().buildObject();
        nameID.setValue(data.getPrincipal().getName());
        nameID.setFormat(NameIdentifier.EMAIL);
        subject.setNameID(nameID);

        //Build the Subject Confirmation
View Full Code Here

TOP

Related Classes of org.opensaml.saml2.core.impl.NameIDBuilder

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.