use of org.scribe.model.OAuthRequest in project mamute by caelum.
the class GoogleAPI method makeRequest.
private Response makeRequest(Token accessToken) {
OAuthRequest request = new OAuthRequest(Verb.GET, "https://www.googleapis.com/plus/v1/people/me");
service.signRequest(accessToken, request);
request.addHeader("GData-Version", "3.0");
return request.send();
}
use of org.scribe.model.OAuthRequest in project OpenOLAT by OpenOLAT.
the class TequilaProvider method getUser.
@Override
public OAuthUser getUser(OAuthService service, Token accessToken) {
String endpoint = oauthModule.getTequilaOAuth2Endpoint();
if (!endpoint.endsWith("/")) {
endpoint += "/";
}
OAuthRequest request = new OAuthRequest(Verb.GET, endpoint + "userinfo");
service.signRequest(accessToken, request);
request.addHeader("Accept", "application/json");
Response oauthResponse = request.send();
String body = oauthResponse.getBody();
return parseResponse(body);
}
use of org.scribe.model.OAuthRequest in project OpenOLAT by OpenOLAT.
the class Google2Provider method getUser.
@Override
public OAuthUser getUser(OAuthService service, Token accessToken) {
OAuthRequest oauthRequest = new OAuthRequest(Verb.GET, "https://www.googleapis.com/oauth2/v2/userinfo");
service.signRequest(accessToken, oauthRequest);
Response oauthResponse = oauthRequest.send();
String body = oauthResponse.getBody();
return parseInfos(body);
}
use of org.scribe.model.OAuthRequest in project OpenOLAT by OpenOLAT.
the class LinkedInProvider method getUser.
@Override
public OAuthUser getUser(OAuthService service, Token accessToken) {
OAuthRequest oauthRequest = new OAuthRequest(Verb.GET, "http://api.linkedin.com/v1/people/~:(id,first-name,last-name,email-address)");
service.signRequest(accessToken, oauthRequest);
Response oauthResponse = oauthRequest.send();
String body = oauthResponse.getBody();
return parseInfos(body);
}
use of org.scribe.model.OAuthRequest in project OpenOLAT by OpenOLAT.
the class TwitterProvider method getUser.
@Override
public OAuthUser getUser(OAuthService service, Token accessToken) {
OAuthRequest oauthRequest = new OAuthRequest(Verb.GET, "https://api.twitter.com/1.1/account/verify_credentials.json");
service.signRequest(accessToken, oauthRequest);
Response oauthResponse = oauthRequest.send();
String body = oauthResponse.getBody();
return parseInfos(body);
}
Aggregations