Examples of SAMLTokenPrincipal


Examples of org.apache.ws.security.SAMLTokenPrincipal

            result.put(WSSecurityEngineResult.TAG_VALIDATED_TOKEN, Boolean.TRUE);
            if (credential.getTransformedToken() != null) {
                result.put(
                    WSSecurityEngineResult.TAG_TRANSFORMED_TOKEN, credential.getTransformedToken()
                );
                SAMLTokenPrincipal samlPrincipal =
                    new SAMLTokenPrincipal(credential.getTransformedToken());
                result.put(WSSecurityEngineResult.TAG_PRINCIPAL, samlPrincipal);
            } else {
                WSUsernameTokenPrincipal principal =
                    new WSUsernameTokenPrincipal(token.getName(), token.isHashed());
                principal.setNonce(token.getNonce());
View Full Code Here

Examples of org.apache.ws.security.SAMLTokenPrincipal

            result.put(WSSecurityEngineResult.TAG_VALIDATED_TOKEN, Boolean.TRUE);
            if (credential.getTransformedToken() != null) {
                result.put(
                    WSSecurityEngineResult.TAG_TRANSFORMED_TOKEN, credential.getTransformedToken()
                );
                SAMLTokenPrincipal samlPrincipal =
                    new SAMLTokenPrincipal(credential.getTransformedToken());
                result.put(WSSecurityEngineResult.TAG_PRINCIPAL, samlPrincipal);
            } else if (credential.getPrincipal() != null) {
                result.put(WSSecurityEngineResult.TAG_PRINCIPAL, credential.getPrincipal());
            } else {
                result.put(WSSecurityEngineResult.TAG_PRINCIPAL, new SAMLTokenPrincipal(assertion));
            }
        }
        wsDocInfo.addResult(result);
        return java.util.Collections.singletonList(result);
    }
View Full Code Here

Examples of org.apache.wss4j.common.principal.SAMLTokenPrincipal

            parameterBean.addAttributeValue(
                ((UsernameTokenType)parameter).getUsername().getValue()
            );
        } else if (parameter instanceof Element) {
            SamlAssertionWrapper wrapper = new SamlAssertionWrapper((Element)parameter);
            SAMLTokenPrincipal principal = new SAMLTokenPrincipalImpl(wrapper);
            parameterBean.addAttributeValue(principal.getName());
        }

        return parameterBean;
    }
View Full Code Here

Examples of org.apache.wss4j.common.principal.SAMLTokenPrincipal

       
        try {
            Element validateTargetElement = (Element)validateTarget.getToken();
            SamlAssertionWrapper assertion = new SamlAssertionWrapper(validateTargetElement);
           
            SAMLTokenPrincipal samlPrincipal = new SAMLTokenPrincipalImpl(assertion);
            response.setPrincipal(samlPrincipal);
           
            if (!assertion.isSigned()) {
                LOG.log(Level.WARNING, "The received assertion is not signed, and therefore not trusted");
                return response;
View Full Code Here

Examples of org.apache.wss4j.common.principal.SAMLTokenPrincipal

    }

    @Override
    public Principal getPrincipal() throws WSSecurityException {
        if (this.principal == null) {
            this.principal = new SAMLTokenPrincipal() {
                @Override
                public SamlAssertionWrapper getToken() {
                    return samlAssertionWrapper;
                }
View Full Code Here

Examples of org.apache.wss4j.common.principal.SAMLTokenPrincipal

    }

    @Override
    public Principal getPrincipal() throws WSSecurityException {
        if (this.principal == null) {
            this.principal = new SAMLTokenPrincipal() {
                @Override
                public SamlAssertionWrapper getToken() {
                    return samlAssertionWrapper;
                }
View Full Code Here

Examples of org.apache.wss4j.common.principal.SAMLTokenPrincipal

            parameterBean.addAttributeValue(
                ((UsernameTokenType)parameter).getUsername().getValue()
            );
        } else if (parameter instanceof Element) {
            SamlAssertionWrapper wrapper = new SamlAssertionWrapper((Element)parameter);
            SAMLTokenPrincipal principal = new SAMLTokenPrincipalImpl(wrapper);
            parameterBean.addAttributeValue(principal.getName());
        }

        return parameterBean;
    }
View Full Code Here

Examples of org.apache.wss4j.common.principal.SAMLTokenPrincipal

            parameterBean.addAttributeValue(
                ((UsernameTokenType)parameter).getUsername().getValue()
            );
        } else if (parameter instanceof Element) {
            SamlAssertionWrapper wrapper = new SamlAssertionWrapper((Element)parameter);
            SAMLTokenPrincipal principal = new SAMLTokenPrincipalImpl(wrapper);
            parameterBean.addAttributeValue(principal.getName());
        }

        return parameterBean;
    }
View Full Code Here

Examples of org.apache.wss4j.common.principal.SAMLTokenPrincipal

            if (stsProperties.getSamlRealmCodec() != null) {
                SamlAssertionWrapper assertion = fetchSAMLAssertionFromWSSecuritySAMLToken(context);

                if (assertion != null) {
                    String wssecRealm = stsProperties.getSamlRealmCodec().getRealmFromToken(assertion);
                    SAMLTokenPrincipal samlPrincipal = new SAMLTokenPrincipalImpl(assertion);
                    if (LOG.isLoggable(Level.FINE)) {
                        LOG.fine("SAML token realm of user '" + samlPrincipal.getName() + "' is " + wssecRealm);
                    }

                    ReceivedToken wssecToken = new ReceivedToken(assertion.getElement());
                    wssecToken.setState(STATE.VALID);
                    TokenValidatorResponse tokenResponse = new TokenValidatorResponse();
View Full Code Here

Examples of org.apache.wss4j.common.principal.SAMLTokenPrincipal

       
        try {
            Element validateTargetElement = (Element)validateTarget.getToken();
            SamlAssertionWrapper assertion = new SamlAssertionWrapper(validateTargetElement);
           
            SAMLTokenPrincipal samlPrincipal = new SAMLTokenPrincipalImpl(assertion);
            response.setPrincipal(samlPrincipal);
           
            SecurityToken secToken = null;
            byte[] signatureValue = assertion.getSignatureValue();
            if (tokenParameters.getTokenStore() != null && signatureValue != null
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.