package com.github.scribejava.apis; import com.github.scribejava.apis.openid.OpenIdJsonTokenExtractor; import com.github.scribejava.core.builder.api.DefaultApi20; import com.github.scribejava.core.extractors.TokenExtractor; import com.github.scribejava.core.model.OAuth2AccessToken; public class TwitterApi20 extends DefaultApi20 { private static final String AUTHORIZE_URL = "https://twitter.com/i/oauth2/authorize"; private static final String ACCESS_TOKEN_RESOURCE = "https://api.twitter.com/2/oauth2/token"; protected TwitterApi20() { } public static TwitterApi20 instance() { return TwitterApi20.InstanceHolder.INSTANCE; } public String getAccessTokenEndpoint() { return ACCESS_TOKEN_RESOURCE; } public String getAuthorizationBaseUrl() { return AUTHORIZE_URL; } public TokenExtractor getAccessTokenExtractor() { return OpenIdJsonTokenExtractor.instance(); } private static class InstanceHolder { private static final TwitterApi20 INSTANCE = new TwitterApi20(); private InstanceHolder() { } } }