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);
}
Aggregations