org.apache.oltu.oauth2.common.token.BasicOAuthToken Java Examples
The following examples show how to use
org.apache.oltu.oauth2.common.token.BasicOAuthToken.
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: OAuth.java From openapi-generator with Apache License 2.0 | 5 votes |
public synchronized void updateAccessToken(RequestTemplate template) { OAuthJSONAccessTokenResponse accessTokenResponse; try { accessTokenResponse = oauthClient.accessToken(tokenRequestBuilder.buildBodyMessage()); } catch (Exception e) { throw new RetryableException(e.getMessage(), e,null); } if (accessTokenResponse != null && accessTokenResponse.getAccessToken() != null) { setAccessToken(accessTokenResponse.getAccessToken(), accessTokenResponse.getExpiresIn()); if (accessTokenListener != null) { accessTokenListener.notify((BasicOAuthToken) accessTokenResponse.getOAuthToken()); } } }
Example #2
Source File: OAuth.java From docusign-java-client with MIT License | 5 votes |
public synchronized void updateAccessToken() { OAuthJSONAccessTokenResponse accessTokenResponse; try { accessTokenResponse = oauthClient.accessToken(tokenRequestBuilder.buildBodyMessage()); } catch (Exception e) { throw new ClientHandlerException(e.getMessage(), e); } if (accessTokenResponse != null) { // FIXME: This does not work in case of non HTTP 200 :-( oauthClient needs to return the plain HTTP resonse if (accessTokenResponse.getResponseCode() != Response.Status.OK.getStatusCode()) { throw new ClientHandlerException("Error while requesting an access token, received HTTP code: " + accessTokenResponse.getResponseCode()); } if (accessTokenResponse.getAccessToken() == null) { throw new ClientHandlerException("Error while requesting an access token. No 'access_token' found."); } if (accessTokenResponse.getExpiresIn() == null) { throw new ClientHandlerException("Error while requesting an access token. No 'expires_in' found."); } setAccessToken(accessTokenResponse.getAccessToken(), accessTokenResponse.getExpiresIn()); if (this.accessTokenListener != null) { this.accessTokenListener.notify((BasicOAuthToken)accessTokenResponse.getOAuthToken()); } } else { // in case of HTTP error codes accessTokenResponse is null, thus no check of accessTokenResponse.getResponseCode() possible :-( throw new ClientHandlerException("Error while requesting an access token. No accessTokenResponse object recieved, maybe a non HTTP 200 received?"); } }
Example #3
Source File: OAuthJSONAccessTokenResponse.java From orion.server with Eclipse Public License 1.0 | 4 votes |
public OAuthToken getOAuthToken() { return new BasicOAuthToken(getAccessToken(), getExpiresIn(), getRefreshToken(), getScope()); }
Example #4
Source File: GitHubTokenResponse.java From orion.server with Eclipse Public License 1.0 | 4 votes |
public OAuthToken getOAuthToken() { return new BasicOAuthToken(getAccessToken(), getExpiresIn(), getRefreshToken(), getScope()); }
Example #5
Source File: OAuthTokenResponse.java From orion.server with Eclipse Public License 1.0 | 4 votes |
public OAuthToken getOAuthToken() { return new BasicOAuthToken(getAccessToken(), getExpiresIn(), getRefreshToken(), getScope()); }
Example #6
Source File: OAuth.java From openapi-generator with Apache License 2.0 | votes |
void notify(BasicOAuthToken token);
Example #7
Source File: OAuth.java From openapi-generator with Apache License 2.0 | votes |
public void notify(BasicOAuthToken token);
Example #8
Source File: OAuth.java From openapi-generator with Apache License 2.0 | votes |
public void notify(BasicOAuthToken token);
Example #9
Source File: OAuth.java From openapi-generator with Apache License 2.0 | votes |
public void notify(BasicOAuthToken token);
Example #10
Source File: OAuth.java From android with MIT License | votes |
public void notify(BasicOAuthToken token);
Example #11
Source File: AccessTokenListener.java From docusign-java-client with MIT License | votes |
void notify(BasicOAuthToken token);