Examples of validateToken()


Examples of com.cloudbees.api.oauth.OauthClient.validateToken()

        OauthToken oauthToken;
        try {
            //Validate scopes
            if(secureAnnotation.validateAllScopes()){
                oauthToken = oauthClient.validateToken(token);
                if(oauthToken != null){
                    for(String scope:scopes){
                        if(!oauthToken.validateScope(scope)){
                            throw new AuthException(401, String.format("Expected scope: %s not found on the token", scope));
                        }
View Full Code Here

Examples of org.apache.cxf.rs.security.oauth.provider.DefaultOAuthValidator.validateToken()

        }
       
        DefaultOAuthValidator validator = new DefaultOAuthValidator();
        validator.validateMessage(oAuthMessage, accessor);
        if (token != null) {
            validator.validateToken(token, provider);
        }
    }
   
    public static OAuthMessage getOAuthMessage(HttpServletRequest request,
                                               String[] requiredParams) throws Exception {
View Full Code Here

Examples of org.apache.cxf.rs.security.oauth.provider.DefaultOAuthValidator.validateToken()

        }
       
        DefaultOAuthValidator validator = new DefaultOAuthValidator();
        validator.validateMessage(oAuthMessage, accessor);
        if (token != null) {
            validator.validateToken(token, provider);
        }
    }
   
    public static OAuthMessage getOAuthMessage(MessageContext mc,
                                               HttpServletRequest request,
View Full Code Here

Examples of org.apache.cxf.sts.token.validator.SAMLTokenValidator.validateToken()

        validatorParameters.setToken(validateTarget);
       
        assertTrue(samlTokenValidator.canHandleToken(validateTarget));
       
        TokenValidatorResponse validatorResponse =
                samlTokenValidator.validateToken(validatorParameters);
        assertTrue(validatorResponse != null);
        assertTrue(validatorResponse.getToken() != null);
        assertTrue(validatorResponse.getToken().getState() == STATE.VALID);
       
        // Renew the Assertion
View Full Code Here

Examples of org.apache.cxf.sts.token.validator.SAMLTokenValidator.validateToken()

        validatorParameters.setToken(validateTarget);
       
        assertTrue(samlTokenValidator.canHandleToken(validateTarget));
       
        TokenValidatorResponse validatorResponse =
                samlTokenValidator.validateToken(validatorParameters);
        assertTrue(validatorResponse != null);
        assertTrue(validatorResponse.getToken() != null);
        assertTrue(validatorResponse.getToken().getState() == STATE.VALID);
       
        // Renew the Assertion
View Full Code Here

Examples of org.apache.cxf.sts.token.validator.SAMLTokenValidator.validateToken()

        tokenRequirements.setValidateTarget(renewTarget);
        validatorParameters.setToken(renewTarget);
       
        // Validate the token
        TokenValidatorResponse validatorResponse =
            samlTokenValidator.validateToken(validatorParameters);
        assertTrue(validatorResponse != null);
        assertTrue(validatorResponse.getToken() != null);
        assertTrue(validatorResponse.getToken().getState() == STATE.EXPIRED);
        assertTrue(validatorResponse.getTokenRealm().equals("A"));
       
View Full Code Here

Examples of org.apache.cxf.sts.token.validator.SAMLTokenValidator.validateToken()

        // Now validate it again
        ReceivedToken validateTarget = new ReceivedToken(renewerResponse.getToken());
        tokenRequirements.setValidateTarget(validateTarget);
        validatorParameters.setToken(validateTarget);
       
        validatorResponse = samlTokenValidator.validateToken(validatorParameters);
        assertTrue(validatorResponse != null);
        assertTrue(validatorResponse.getToken() != null);
        assertTrue(validatorResponse.getToken().getState() == STATE.VALID);
    }
   
View Full Code Here

Examples of org.apache.cxf.sts.token.validator.SAMLTokenValidator.validateToken()

        tokenRequirements.setValidateTarget(renewTarget);
        validatorParameters.setToken(renewTarget);
       
        // Validate the token
        TokenValidatorResponse validatorResponse =
            samlTokenValidator.validateToken(validatorParameters);
        assertTrue(validatorResponse != null);
        assertTrue(validatorResponse.getToken() != null);
        assertTrue(validatorResponse.getToken().getState() == STATE.EXPIRED);
        assertTrue(validatorResponse.getTokenRealm().equals("B"));
       
View Full Code Here

Examples of org.apache.cxf.sts.token.validator.SAMLTokenValidator.validateToken()

        // Now validate it again
        ReceivedToken validateTarget = new ReceivedToken(renewerResponse.getToken());
        tokenRequirements.setValidateTarget(validateTarget);
        validatorParameters.setToken(validateTarget);
       
        validatorResponse = samlTokenValidator.validateToken(validatorParameters);
        assertTrue(validatorResponse != null);
        assertTrue(validatorResponse.getToken() != null);
        assertTrue(validatorResponse.getToken().getState() == STATE.VALID);
    }
   
View Full Code Here

Examples of org.apache.cxf.sts.token.validator.SAMLTokenValidator.validateToken()

        validatorParameters.setToken(validateTarget);
       
        assertTrue(samlTokenValidator.canHandleToken(validateTarget));
       
        TokenValidatorResponse validatorResponse =
                samlTokenValidator.validateToken(validatorParameters);
        assertTrue(validatorResponse != null);
        assertTrue(validatorResponse.getToken() != null);
        assertTrue(validatorResponse.getToken().getState() == STATE.VALID);
       
        // Renew the Assertion
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.