Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package ru.hh.oauth.subscribe.apis;
 
public class GoogleApi20 extends DefaultApi20 {
    private static final String AUTHORIZE_URL
            = "https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=%s&redirect_uri=%s&scope=%s";
    @Override
    public Verb getAccessTokenVerb() {
        return .;
    }
    @Override
    public String getAccessTokenEndpoint() {
        return "https://accounts.google.com/o/oauth2/token";
    }
    @Override
    public String getAuthorizationUrl(final OAuthConfig config) {
        Preconditions.checkValidUrl(config.getCallback(),
                "Must provide a valid url as callback. Google+ does not support OOB");
        final StringBuilder sb = new StringBuilder(String.format(config.getApiKey(), OAuthEncoder.encode(
                config.getCallback()), OAuthEncoder.encode(config.getScope())));
        final String state = config.getState();
        if (state != null) {
            sb.append('&').append(.).append('=').append(OAuthEncoder.encode(state));
        }
        return sb.toString();
    }
    @Override
        return new GoogleJsonTokenExtractor();
    }
    @Override
    public OAuthService createService(OAuthConfig config) {
        return new GoogleOAuthServiceImpl(thisconfig);
    }
New to GrepCode? Check out our FAQ X