Search in sources :

Example 1 with DefaultApi10a

use of org.scribe.builder.api.DefaultApi10a in project muikku by otavanopisto.

the class OAuthAuthenticationStrategy method performDiscovery.

protected AuthenticationResult performDiscovery(AuthSource authSource, Map<String, String[]> requestParameters, String... scopes) {
    OAuthService service = getOAuthService(authSource, requestParameters, scopes);
    Token requestToken = null;
    boolean isV1 = getApi() instanceof DefaultApi10a;
    // For OAuth version 1 the request token is fetched, for v2 it's not
    if (isV1)
        requestToken = service.getRequestToken();
    String url = service.getAuthorizationUrl(requestToken);
    loginSessionBean.setRequestToken(requestToken);
    return new AuthenticationResult(AuthenticationResult.Status.PROCESSING, url);
}
Also used : OAuthService(org.scribe.oauth.OAuthService) Token(org.scribe.model.Token) DefaultApi10a(org.scribe.builder.api.DefaultApi10a)

Aggregations

DefaultApi10a (org.scribe.builder.api.DefaultApi10a)1 Token (org.scribe.model.Token)1 OAuthService (org.scribe.oauth.OAuthService)1