Examples of OauthToken


Examples of org.apache.oltu.oauth2.common.token.OAuthToken

                .setRefreshToken(parameters.refreshToken)
                .buildBodyMessage();

        OAuthClient oAuthClient = getOAuthClient();

        OAuthToken oAuthToken = oAuthClient.accessToken(accessTokenRequest, OAuthJSONAccessTokenResponse.class).getOAuthToken();
        parameters.applyRetrievedAccessToken(oAuthToken.getAccessToken());
        parameters.setAccessTokenIssuedTimeInProfile(TimeUtils.getCurrentTimeInSeconds());
    }
View Full Code Here

Examples of org.apache.oltu.oauth2.common.token.OAuthToken

                        .setClientId(parameters.clientId)
                        .setClientSecret(parameters.clientSecret)
                        .setRedirectURI(parameters.redirectUri)
                        .setCode(authorizationCode)
                        .buildBodyMessage();
                OAuthToken token = getOAuthClient().accessToken(accessTokenRequest, OAuth2AccessTokenResponse.class)
                        .getOAuthToken();
                if (token != null && token.getAccessToken() != null) {
                    parameters.setAccessTokenInProfile(token.getAccessToken());
                    parameters.setRefreshTokenInProfile(token.getRefreshToken());
                    if (token.getExpiresIn() != null) {
                        parameters.setAccessTokenExpirationTimeInProfile(token.getExpiresIn());
                    }
                    parameters.setAccessTokenIssuedTimeInProfile(TimeUtils.getCurrentTimeInSeconds());

                    browserFacade.close();
                }
View Full Code Here

Examples of org.eurekastreams.server.domain.OAuthToken

                oneOf(actionContext).getParams();
                will(returnValue(new GetConsumerTokenInfoRequest(securityToken, consumerInfo, "serviceName",
                        "tokenName")));

                OAuthConsumer consumer = new OAuthConsumer("", "", "", "", "");
                OAuthToken token = new OAuthToken(consumer, "", "", "", "");
                token.setTokenExpireMillis(0L);

                oneOf(securityToken).getAppUrl();
                will(returnValue("http://localhost:4040/some/path"));

                oneOf(securityToken).getViewerId();
View Full Code Here

Examples of org.jboss.resteasy.auth.oauth.OAuthToken

                    OAuth.OAUTH_NONCE);

            String consumerKey = message.getParameter(OAuth.OAUTH_CONSUMER_KEY);
            org.jboss.resteasy.auth.oauth.OAuthConsumer consumer = oauthProvider.getConsumer(consumerKey);
       
            OAuthToken accessToken = null;
            String accessTokenString = message.getParameter(OAuth.OAUTH_TOKEN);
           
            if (accessTokenString != null) {
                accessToken = oauthProvider.getAccessToken(consumer.getKey(), accessTokenString);
                OAuthUtils.validateRequestWithAccessToken(
View Full Code Here

Examples of org.jboss.resteasy.auth.oauth.OAuthToken

               
                if (consumerKey != null && !tokenConsumerKey.equals(consumerKey)) {
                    throw new OAuthException(HttpURLConnection.HTTP_UNAUTHORIZED, "No such consumer key "+consumerKey);
                }
               
                return new OAuthToken(token, secret,
                        scopes == null ? null : new String[] {scopes},
                        permissions == null ? null : new String[] {permissions},       
                        -1, getConsumer(tokenConsumerKey));
            } else {
                throw new OAuthException(HttpURLConnection.HTTP_UNAUTHORIZED, "No such consumer key "+consumerKey);
View Full Code Here

Examples of org.jboss.resteasy.auth.oauth.OAuthToken

                    + secret + "'"
                    + ", " + (scopes != null ? "'" + scopes[0] + "'" : null)
                    + ", " + (permissions != null ? "'" + permissions[0] + "'" : null)
                    + ")");
        
            return new OAuthToken(token, secret,
                    requestToken.getScopes(), requestToken.getPermissions(), -1, requestToken.getConsumer());
         } catch (SQLException ex) {
             throw new OAuthException(HttpURLConnection.HTTP_UNAUTHORIZED,
                     "Request token for the consumer with key " + consumerKey + " can not be created");
         }
View Full Code Here

Examples of org.jboss.resteasy.auth.oauth.OAuthToken

               
                if (consumerKey != null && !tokenConsumerKey.equals(consumerKey)) {
                    throw new OAuthException(HttpURLConnection.HTTP_UNAUTHORIZED, "No such consumer key "+consumerKey);
                }
               
                return new OAuthToken(token, secret,
                        scopes == null ? null : new String[] {scopes},
                        permissions == null ? null : new String[] {permissions},       
                        -1, getConsumer(tokenConsumerKey));
            } else {
                throw new OAuthException(HttpURLConnection.HTTP_UNAUTHORIZED, "No such consumer key "+consumerKey);
View Full Code Here

Examples of org.jboss.resteasy.auth.oauth.OAuthToken

                    + secret + "'"
                    + ", " + (scopes != null ? "'" + scopes[0] + "'" : null)
                    + ", " + (permissions != null ? "'" + permissions[0] + "'" : null)
                    + ")");
        
            return new OAuthToken(token, secret,
                    requestToken.getScopes(), requestToken.getPermissions(), -1, requestToken.getConsumer());
         } catch (SQLException ex) {
             throw new OAuthException(HttpURLConnection.HTTP_UNAUTHORIZED,
                     "Request token for the consumer with key " + consumerKey + " can not be created");
         }
View Full Code Here

Examples of org.jboss.resteasy.auth.oauth.OAuthToken

                    OAuth.OAUTH_NONCE);

            String consumerKey = message.getParameter(OAuth.OAUTH_CONSUMER_KEY);
            org.jboss.resteasy.auth.oauth.OAuthConsumer consumer = oauthProvider.getConsumer(consumerKey);
       
            OAuthToken accessToken = null;
            String accessTokenString = message.getParameter(OAuth.OAUTH_TOKEN);
           
            if (accessTokenString != null) {
                accessToken = oauthProvider.getAccessToken(consumer.getKey(), accessTokenString);
                OAuthUtils.validateRequestWithAccessToken(
View Full Code Here

Examples of org.openstreetmap.josm.data.oauth.OAuthToken

        public void build() {
            if (! valAccessTokenKey.isValid() || !valAccessTokenSecret.isValid()) {
                setAccessToken(null);
            } else {
                setAccessToken(new OAuthToken(tfAccessTokenKey.getText().trim(), tfAccessTokenSecret.getText().trim()));
            }
        }
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.