private String getAuthorizationCode(HttpServletRequest request) throws ApplicationAuthenticatorException { OAuthAuthzResponse authzResponse; try { authzResponse = OAuthAuthzResponse.oauthCodeAuthzResponse(request); return authzResponse.getCode(); } catch (OAuthProblemException e) { throw new ApplicationAuthenticatorException("Exception while reading authorization code.", e); } }
public String getCode() { return getParam(OAuth.OAUTH_CODE); }
OAuthAuthzResponse authzResponse = OAuthAuthzResponse.oauthCodeAuthzResponse(request); OAuthClientRequest accessTokenRequest = getAccessTokenRequest(context, authzResponse);
public static OAuthAuthzResponse oauthCodeAuthzResponse(HttpServletRequest request) throws OAuthProblemException { OAuthAuthzResponse response = new OAuthAuthzResponse(request, new CodeValidator()); response.validate(); return response; }
public static OAuthAuthzResponse oAuthCodeAndTokenAuthzResponse(HttpServletRequest request) throws OAuthProblemException { OAuthAuthzResponse response = new OAuthAuthzResponse(request, new CodeTokenValidator()); response.validate(); return response; }
protected String getAuthorizationCode(HttpServletRequest request) throws ApplicationAuthenticatorException { OAuthAuthzResponse authzResponse; try { authzResponse = OAuthAuthzResponse.oauthCodeAuthzResponse(request); return authzResponse.getCode(); } catch (OAuthProblemException e) { throw new ApplicationAuthenticatorException("Exception while reading authorization code.", e); } }
public static OAuthAuthzResponse oauthTokenAuthzResponse(HttpServletRequest request) throws OAuthProblemException { OAuthAuthzResponse response = new OAuthAuthzResponse(request, new TokenValidator()); response.validate(); return response; }
public String getAccessToken() { return getParam(OAuth.OAUTH_ACCESS_TOKEN); }
private String getAuthorizationCode(HttpServletRequest request) throws ApplicationAuthenticatorException { OAuthAuthzResponse authzResponse; try { authzResponse = OAuthAuthzResponse.oauthCodeAuthzResponse(request); return authzResponse.getCode(); } catch (OAuthProblemException e) { throw new ApplicationAuthenticatorException("Exception while reading authorization code.", e); } }
public static OAuthAuthzResponse oauthCodeAuthzResponse(HttpServletRequest request) throws OAuthProblemException { OAuthAuthzResponse response = new OAuthAuthzResponse(request, new CodeValidator()); response.validate(); return response; }
public String getState() { return getParam(OAuth.OAUTH_STATE); }
@Override public Optional<AccessTokenResponse> getAccessToken(final HttpServletRequest req, final String redirectUri) { try { OAuthAuthzResponse oar = OAuthAuthzResponse.oauthCodeAuthzResponse(req); OAuthClientRequest request = OAuthClientRequest .tokenLocation(tokenEndpointURL) .setClientId(clientId) .setClientSecret(clientSecret) .setRedirectURI(redirectUri) .setGrantType(GrantType.AUTHORIZATION_CODE) .setCode(oar.getCode()) .buildBodyMessage(); OAuthClient client = new OAuthClient(new URLConnectionClient()); return Optional.of(client.accessToken(request, OltuAccessTokenResponse.class)); } catch (OAuthSystemException | OAuthProblemException e) { LOGGER.error("Authentication failed.", e); return Optional.empty(); } }
public static OAuthAuthzResponse oauthTokenAuthzResponse(HttpServletRequest request) throws OAuthProblemException { OAuthAuthzResponse response = new OAuthAuthzResponse(request, new TokenValidator()); response.validate(); return response; }
public String getScope() { return getParam(OAuth.OAUTH_SCOPE); }
OAuthAuthzResponse authzResponse = OAuthAuthzResponse.oauthCodeAuthzResponse(request); String code = authzResponse.getCode();
public static OAuthAuthzResponse oAuthCodeAndTokenAuthzResponse(HttpServletRequest request) throws OAuthProblemException { OAuthAuthzResponse response = new OAuthAuthzResponse(request, new CodeTokenValidator()); response.validate(); return response; }
public String getState() { return getParam(OAuth.OAUTH_STATE); }
public View verify() throws OAuthProblemException, OAuthSystemException, ParseException{ HttpServletRequest request = getPath().getRequest(); OAuthAuthzResponse oar = OAuthAuthzResponse.oauthCodeAuthzResponse(request); String code = oar.getCode();
public String getScope() { return getParam(OAuth.OAUTH_SCOPE); }