Package com.sun.jersey.oauth.server

Examples of com.sun.jersey.oauth.server.OAuthSecurityContext


        // do not filter if the request path matches pattern to ignore
        if (match(ignorePathPattern, request.getPath())) {
            return request;
        }

        OAuthSecurityContext sc = null;

        try {
            sc = getSecurityContext(request);
        } catch (OAuthException e) {
            if (optional) {
View Full Code Here


        if (consumer == null) {
            throw newUnauthorizedException();
        }

        OAuthSecrets secrets = new OAuthSecrets().consumerSecret(consumer.getSecret());
        OAuthSecurityContext sc;
        String nonceKey;

        if (token == null) {
            if (consumer.getPrincipal() == null) {
                throw newUnauthorizedException();
            }
            nonceKey = "c:" + consumerKey;
            sc = new OAuthSecurityContext(consumer, request.isSecure());
        } else {
            OAuthToken accessToken = provider.getAccessToken(token);
            if (accessToken == null) {
                throw newUnauthorizedException();
            }

            OAuthConsumer atConsumer = accessToken.getConsumer();
            if (atConsumer == null || !consumerKey.equals(atConsumer.getKey())) {
                throw newUnauthorizedException();
            }

            nonceKey = "t:" + token;
            secrets.tokenSecret(accessToken.getSecret());
            sc = new OAuthSecurityContext(accessToken, request.isSecure());
        }

        if (!verifySignature(osr, params, secrets)) {
            throw newUnauthorizedException();
        }
View Full Code Here

TOP

Related Classes of com.sun.jersey.oauth.server.OAuthSecurityContext

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.