org.apache.oltu.oauth2.client.response.OAuthAccessTokenResponse Java Examples

The following examples show how to use org.apache.oltu.oauth2.client.response.OAuthAccessTokenResponse. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: OAuthClient.java    From orion.server with Eclipse Public License 1.0 5 votes vote down vote up
public <T extends OAuthAccessTokenResponse> T accessToken(
    OAuthClientRequest request,
    Class<T> responseClass)
    throws OAuthSystemException, OAuthProblemException {

    return accessToken(request, OAuth.HttpMethod.POST, responseClass);
}
 
Example #2
Source File: OAuthClient.java    From orion.server with Eclipse Public License 1.0 5 votes vote down vote up
public <T extends OAuthAccessTokenResponse> T accessToken(
    OAuthClientRequest request, String requestMethod, Class<T> responseClass)
    throws OAuthSystemException, OAuthProblemException {

    Map<String, String> headers = new HashMap<String, String>();
    headers.put(OAuth.HeaderType.CONTENT_TYPE, OAuth.ContentType.URL_ENCODED);

    return httpClient.execute(request, headers, requestMethod, responseClass);
}
 
Example #3
Source File: GoogleOAuthConsumer.java    From orion.server with Eclipse Public License 1.0 5 votes vote down vote up
public GoogleOAuthConsumer(OAuthAccessTokenResponse oauthAccessTokenResponse, String redirect) throws OAuthException {
	super(oauthAccessTokenResponse, redirect);
	try {
		JSONObject json = new JSONObject(oauthAccessTokenResponse.getBody());
		String jwt = json.getString(TOKEN_PARAMETER);
		parseToken(jwt);
	} catch (JSONException e) {
		throw new OAuthException(e);
	}
}
 
Example #4
Source File: GitHubOAuthConsumer.java    From orion.server with Eclipse Public License 1.0 4 votes vote down vote up
public GitHubOAuthConsumer(OAuthAccessTokenResponse oauthAccessTokenResponse, String redirect) throws OAuthException {
	super(oauthAccessTokenResponse, redirect);
	getGitHubProfile();
	getGitHubEmail();
}
 
Example #5
Source File: GitHubOAuthParams.java    From orion.server with Eclipse Public License 1.0 4 votes vote down vote up
public Class<? extends OAuthAccessTokenResponse> getTokenResponseClass() {
	return TOKEN_RESPONSE_CLASS;
}
 
Example #6
Source File: GitHubOAuthParams.java    From orion.server with Eclipse Public License 1.0 4 votes vote down vote up
public OAuthConsumer getNewOAuthConsumer(OAuthAccessTokenResponse oauthAccessTokenResponse) throws OAuthException {
	return new GitHubOAuthConsumer(oauthAccessTokenResponse, getRedirect());
}
 
Example #7
Source File: OAuthConsumer.java    From orion.server with Eclipse Public License 1.0 4 votes vote down vote up
public OAuthConsumer(OAuthAccessTokenResponse oauthAccessTokenResponse, String redirect) {
	this.redirect = redirect;
	accessToken = oauthAccessTokenResponse.getOAuthToken();
}
 
Example #8
Source File: GoogleOAuthParams.java    From orion.server with Eclipse Public License 1.0 4 votes vote down vote up
public Class<? extends OAuthAccessTokenResponse> getTokenResponseClass() {
	return TOKEN_RESPONSE_CLASS;
}
 
Example #9
Source File: GoogleOAuthParams.java    From orion.server with Eclipse Public License 1.0 4 votes vote down vote up
public OAuthConsumer getNewOAuthConsumer(OAuthAccessTokenResponse oauthAccessTokenResponse) throws OAuthException {
	return new GoogleOAuthConsumer(oauthAccessTokenResponse, getRedirect());
}
 
Example #10
Source File: OAuthParams.java    From orion.server with Eclipse Public License 1.0 votes vote down vote up
public abstract Class<? extends OAuthAccessTokenResponse> getTokenResponseClass(); 
Example #11
Source File: OAuthParams.java    From orion.server with Eclipse Public License 1.0 votes vote down vote up
public abstract OAuthConsumer getNewOAuthConsumer(OAuthAccessTokenResponse oauthAccessTokenResponse) throws OAuthException;