Examples of BSPEnforcer


Examples of org.apache.wss4j.dom.bsp.BSPEnforcer

        try {
            boolean allowNamespaceQualifiedPasswordTypes =
                wssConfig.getAllowNamespaceQualifiedPasswordTypes();
            UsernameToken ut =
                new UsernameToken(usernameTokenElement, allowNamespaceQualifiedPasswordTypes,
                                  new BSPEnforcer());
            // The parsed principal is set independent whether validation is successful or not
            response.setPrincipal(new CustomTokenPrincipal(ut.getName()));
            if (ut.getPassword() == null) {
                return response;
            }
View Full Code Here

Examples of org.apache.wss4j.dom.bsp.BSPEnforcer

                ref = securityToken.getUnattachedReference();
            }
           
            if (ref != null) {
                SecurityTokenReference secRef =
                    new SecurityTokenReference(cloneElement(ref), new BSPEnforcer());
                sig.setSecurityTokenReference(secRef);
                sig.setKeyIdentifierType(WSConstants.CUSTOM_KEY_IDENTIFIER);
            } else {
                int type = attached ? WSConstants.CUSTOM_SYMM_SIGNING
                    : WSConstants.CUSTOM_SYMM_SIGNING_DIRECT;
View Full Code Here

Examples of org.apache.wss4j.dom.bsp.BSPEnforcer

                        }

                        String tokenType = encrTok.getTokenType();
                        if (ref != null) {
                            SecurityTokenReference secRef =
                                new SecurityTokenReference(cloneElement(ref), new BSPEnforcer());
                            encr.setSecurityTokenReference(secRef);
                        } else if (WSConstants.WSS_SAML_TOKEN_TYPE.equals(tokenType)
                            || WSConstants.SAML_NS.equals(tokenType)) {
                            encr.setCustomReferenceValue(WSConstants.WSS_SAML_KI_VALUE_TYPE);
                            encr.setKeyIdentifierType(WSConstants.CUSTOM_KEY_IDENTIFIER);
View Full Code Here

Examples of org.apache.wss4j.dom.bsp.BSPEnforcer

                    ref = tok.getUnattachedReference();
                }
               
                if (ref != null) {
                    SecurityTokenReference secRef =
                        new SecurityTokenReference(cloneElement(ref), new BSPEnforcer());
                    sig.setSecurityTokenReference(secRef);
                    sig.setKeyIdentifierType(WSConstants.CUSTOM_KEY_IDENTIFIER);
                } else {
                    String tokenType = tok.getTokenType();
                    if (WSConstants.WSS_SAML_TOKEN_TYPE.equals(tokenType)
View Full Code Here

Examples of org.apache.wss4j.dom.bsp.BSPEnforcer

            ref = secTok.getUnattachedReference();
        }
       
        if (ref != null) {
            SecurityTokenReference secRef =
                new SecurityTokenReference(cloneElement(ref), new BSPEnforcer());
            sig.setSecurityTokenReference(secRef);
            sig.setKeyIdentifierType(WSConstants.CUSTOM_KEY_IDENTIFIER);
        } else if (token instanceof UsernameToken) {
            sig.setCustomTokenId(secTok.getId());
            sig.setCustomTokenValueType(WSConstants.WSS_USERNAME_TOKEN_VALUE_TYPE);
View Full Code Here

Examples of org.apache.wss4j.dom.bsp.BSPEnforcer

        UsernameToken receivedToken =
            (UsernameToken) actionResult.get(WSSecurityEngineResult.TAG_USERNAME_TOKEN);
        assertTrue(receivedToken != null);
       
        UsernameToken clone =
            new UsernameToken(receivedToken.getElement(), false, new BSPEnforcer());
        assertTrue(clone.equals(receivedToken));
        assertTrue(clone.hashCode() == receivedToken.hashCode());
    }
View Full Code Here

Examples of org.apache.wss4j.dom.bsp.BSPEnforcer

        UsernameToken receivedToken =
            (UsernameToken) actionResult.get(WSSecurityEngineResult.TAG_USERNAME_TOKEN);
        assertTrue(receivedToken != null);
       
        UsernameToken clone =
            new UsernameToken(receivedToken.getElement(), false, new BSPEnforcer());
        assertTrue(clone.equals(receivedToken));
        assertTrue(clone.hashCode() == receivedToken.hashCode());
    }
View Full Code Here

Examples of org.apache.wss4j.dom.bsp.BSPEnforcer

        }
       
        // Process the STR
        Element strElement = str.getElement();
        try {
            new SecurityTokenReference(strElement, new BSPEnforcer(true));
            fail("Failure expected on a reference with no URI");
        } catch (WSSecurityException ex) {
            assertTrue(ex.getMessage().contains("Reference URI is null"));
        }
    }
View Full Code Here

Examples of org.apache.wss4j.dom.bsp.BSPEnforcer

       
        if (LOG.isDebugEnabled()) {
            LOG.debug(str.toString());
        }
       
        BSPEnforcer bspEnforcer = new BSPEnforcer();
        // Process the STR
        try {
            new SecurityTokenReference(strElement,bspEnforcer);
            fail("Failure expected on multiple data references");
        } catch (WSSecurityException ex) {
            // Expected
        }
       
        bspEnforcer.setIgnoredBSPRules(Collections.singletonList(BSPRule.R3061));
        new SecurityTokenReference(strElement, bspEnforcer);
    }
View Full Code Here

Examples of org.apache.wss4j.dom.bsp.BSPEnforcer

        if (LOG.isDebugEnabled()) {
            LOG.debug(str.toString());
        }
       
        BSPEnforcer bspEnforcer = new BSPEnforcer();
        // Process the STR
        try {
            new SecurityTokenReference(strElement,bspEnforcer);
            fail("Failure expected on a Key Identifier with no ValueType");
        } catch (WSSecurityException ex) {
            // Expected
        }
       
        bspEnforcer.setIgnoredBSPRules(Collections.singletonList(BSPRule.R3054));
    }
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.