Examples of SAMLTokenPrincipal


Examples of org.apache.ws.security.SAMLTokenPrincipal

       
        try {
            Element validateTargetElement = (Element)validateTarget.getToken();
            AssertionWrapper assertion = new AssertionWrapper(validateTargetElement);
           
            SAMLTokenPrincipal samlPrincipal = new SAMLTokenPrincipal(assertion);
            response.setPrincipal(samlPrincipal);
           
            SecurityToken secToken = null;
            byte[] signatureValue = assertion.getSignatureValue();
            if (tokenParameters.getTokenStore() != null && signatureValue != null
View Full Code Here

Examples of org.apache.ws.security.SAMLTokenPrincipal

    @Override
    protected boolean isUserInRole(SecurityContext sc, List<String> roles, boolean deny) {
        Principal principal = sc.getUserPrincipal();
        if (principal instanceof SAMLTokenPrincipal) {
            SAMLTokenPrincipal samlPrincipal = (SAMLTokenPrincipal)principal;
            AssertionWrapper assertion = samlPrincipal.getToken();
            String role = getRoleFromAssertion(assertion);
            if (roles.contains(role)) {
                return true;
            }
        }
View Full Code Here

Examples of org.apache.ws.security.SAMLTokenPrincipal

     * @return A principal
     */
    private Principal createPrincipalFromSAML(
        AssertionWrapper assertion
    ) {
        SAMLTokenPrincipal samlPrincipal = new SAMLTokenPrincipal(assertion);
        String confirmMethod = null;
        List<String> methods = assertion.getConfirmationMethods();
        if (methods != null && methods.size() > 0) {
            confirmMethod = methods.get(0);
        }
View Full Code Here

Examples of org.apache.ws.security.SAMLTokenPrincipal

       
        try {
            Element validateTargetElement = (Element)validateTarget.getToken();
            AssertionWrapper assertion = new AssertionWrapper(validateTargetElement);
           
            SAMLTokenPrincipal samlPrincipal = new SAMLTokenPrincipal(assertion);
            response.setPrincipal(samlPrincipal);
           
            SecurityToken secToken = null;
            byte[] signatureValue = assertion.getSignatureValue();
            if (tokenParameters.getTokenStore() != null && signatureValue != null
View Full Code Here

Examples of org.apache.ws.security.SAMLTokenPrincipal

     * @return A principal
     */
    private Principal createPrincipalFromSAML(
        AssertionWrapper assertion
    ) {
        SAMLTokenPrincipal samlPrincipal = new SAMLTokenPrincipal(assertion);
        String confirmMethod = null;
        List<String> methods = assertion.getConfirmationMethods();
        if (methods != null && methods.size() > 0) {
            confirmMethod = methods.get(0);
        }
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 {
                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.ws.security.SAMLTokenPrincipal

            if (returnedCredential.getTransformedToken() != null) {
                result.put(
                    WSSecurityEngineResult.TAG_TRANSFORMED_TOKEN,
                    returnedCredential.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 if (certs != null && certs[0] != null) {
                result.put(WSSecurityEngineResult.TAG_PRINCIPAL, certs[0].getSubjectX500Principal());
View Full Code Here

Examples of org.apache.ws.security.SAMLTokenPrincipal

                        break;
                    }
                }
            }
           
            SAMLTokenPrincipal p = new SAMLTokenPrincipal(assertion);

            TokenValidatorResponse response = new TokenValidatorResponse(
                    assertion.getId(), p.getName(), assertionIssuer, roles,
                    new ClaimCollection(claims), audience);
            response.setExpires(getExpires(assertion));
           
            return response;
View Full Code Here

Examples of org.apache.ws.security.SAMLTokenPrincipal

     * @return A principal
     */
    private Principal createPrincipalFromSAML(
        AssertionWrapper assertion
    ) {
        SAMLTokenPrincipal principal = new SAMLTokenPrincipal(assertion);
        String confirmMethod = null;
        List<String> methods = assertion.getConfirmationMethods();
        if (methods != null && methods.size() > 0) {
            confirmMethod = methods.get(0);
        }
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.