private UserInfoResponse getUserInfo(final String accessToken) { logger.debug("Session validation successful. Getting user information"); final UserInfoClient userInfoClient = new UserInfoClient(this.openIdConfiguration.getUserInfoEndpoint()); final UserInfoResponse userInfoResponse = userInfoClient.execUserInfo(accessToken); logger.trace("userInfoResponse.getStatus(): '{}'", userInfoResponse.getStatus()); logger.trace("userInfoResponse.getErrorType(): '{}'", userInfoResponse.getErrorType()); logger.debug("userInfoResponse.getClaims(): '{}'", userInfoResponse.getClaims()); return userInfoResponse; }
public void exec() { try { UserInfoRequest request = new UserInfoRequest(accessToken); request.setAuthorizationMethod(authorizationMethod); UserInfoClient client = new UserInfoClient(userInfoEndpoint); client.setRequest(request); client.exec(); showResults = true; requestString = client.getRequestAsString(); responseString = client.getResponseAsString(); } catch (Exception e) { log.error(e.getMessage(), e); } }
initClientRequest(); clientRequest.header("Content-Type", MediaType.APPLICATION_FORM_URLENCODED); clientRequest.setHttpMethod(getHttpMethod()); if (getRequest().getAuthorizationMethod() == null || getRequest().getAuthorizationMethod() == AuthorizationMethod.AUTHORIZATION_REQUEST_HEADER_FIELD) { if (StringUtils.isNotBlank(getRequest().getAccessToken())) { clientRequest.header("Authorization", "Bearer " + getRequest().getAccessToken()); } else if (getRequest().getAuthorizationMethod() == AuthorizationMethod.FORM_ENCODED_BODY_PARAMETER) { if (StringUtils.isNotBlank(getRequest().getAccessToken())) { clientRequest.formParameter("access_token", getRequest().getAccessToken()); } else if (getRequest().getAuthorizationMethod() == AuthorizationMethod.URL_QUERY_PARAMETER) { if (StringUtils.isNotBlank(getRequest().getAccessToken())) { clientRequest.queryParameter("access_token", getRequest().getAccessToken()); if (getRequest().getAuthorizationMethod() == null || getRequest().getAuthorizationMethod() == AuthorizationMethod.AUTHORIZATION_REQUEST_HEADER_FIELD || getRequest().getAuthorizationMethod() == AuthorizationMethod.URL_QUERY_PARAMETER) { clientResponse = clientRequest.get(String.class); } else if (getRequest().getAuthorizationMethod() == AuthorizationMethod.FORM_ENCODED_BODY_PARAMETER) { clientResponse = clientRequest.post(String.class); setResponse(new UserInfoResponse(status)); getResponse().setEntity(entity); getResponse().setHeaders(clientResponse.getMetadata()); if (StringUtils.isNotBlank(entity)) {
/** * Executes the call to the REST Service and processes the response. * * @param accessToken The access token obtained from the oxAuth authorization request. * @return The service response. */ public UserInfoResponse execUserInfo(String accessToken) { setRequest(new UserInfoRequest(accessToken)); return exec(); }
UserInfoClient userInfoClient = new UserInfoClient(userInfoEndpoint); userInfoClient.setSharedKey(clientSecret); userInfoClient.setRequest(userInfoRequest); UserInfoResponse userInfoResponse = userInfoClient.exec();
UserInfoClient userInfoClient = new UserInfoClient(userInfoEndpoint); userInfoClient.setRequest(userInfoRequest); userInfoClient.setJwksUri(jwksUri); UserInfoResponse userInfoResponse = userInfoClient.exec();
UserInfoClient userInfoClient = new UserInfoClient(userInfoEndpoint); userInfoClient.setPrivateKey(privateKey); userInfoClient.setRequest(userInfoRequest); UserInfoResponse userInfoResponse = userInfoClient.exec();
UserInfoClient userInfoClient = new UserInfoClient(userInfoEndpoint); userInfoClient.setJwksUri(jwksUri); UserInfoResponse userInfoResponse = userInfoClient.execUserInfo(accessToken);
UserInfoClient userInfoClient = new UserInfoClient(userInfoEndpoint); userInfoClient.setSharedKey(clientSecret); UserInfoResponse userInfoResponse = userInfoClient.execUserInfo(accessToken);
userInfoRequest.setAuthorizationMethod(AuthorizationMethod.FORM_ENCODED_BODY_PARAMETER); UserInfoClient userInfoClient = new UserInfoClient(userInfoEndpoint); userInfoClient.setRequest(userInfoRequest); UserInfoResponse userInfoResponse = userInfoClient.exec();
PrivateKey privateKey = cryptoProvider.getPrivateKey(keyId); UserInfoClient userInfoClient = new UserInfoClient(userInfoEndpoint); userInfoClient.setPrivateKey(privateKey); UserInfoResponse userInfoResponse = userInfoClient.execUserInfo(accessToken);
private UserInfoResponse requestUserInfo(String accessToken) throws Exception { UserInfoClient userInfoClient = new UserInfoClient(userInfoEndpoint); userInfoClient.setExecutor(clientExecutor(true)); UserInfoResponse response2 = userInfoClient.execUserInfo(accessToken); assertNotNull(response2.getClaim(JwtClaimName.EMAIL)); return response2; }
UserInfoClient userInfoClient = new UserInfoClient(userInfoEndpoint); userInfoClient.setSharedKey(clientSecret); userInfoClient.setRequest(userInfoRequest); UserInfoResponse userInfoResponse = userInfoClient.exec();
UserInfoClient userInfoClient = new UserInfoClient(userInfoEndpoint); userInfoClient.setRequest(userInfoRequest); userInfoClient.setJwksUri(jwksUri); UserInfoResponse userInfoResponse = userInfoClient.exec();
UserInfoClient userInfoClient = new UserInfoClient(userInfoEndpoint); userInfoClient.setPrivateKey(privateKey); userInfoClient.setRequest(userInfoRequest); UserInfoResponse userInfoResponse = userInfoClient.exec();
UserInfoClient userInfoClient = new UserInfoClient(userInfoEndpoint); userInfoClient.setJwksUri(jwksUri); UserInfoResponse userInfoResponse = userInfoClient.execUserInfo(accessToken);
UserInfoClient userInfoClient = new UserInfoClient(userInfoEndpoint); userInfoClient.setSharedKey(clientSecret); UserInfoResponse userInfoResponse = userInfoClient.execUserInfo(accessToken);
UserInfoClient userInfoClient = new UserInfoClient(userInfoEndpoint); userInfoClient.setRequest(userInfoRequest); UserInfoResponse userInfoResponse = userInfoClient.exec(); UserInfoClient userInfoClient2 = new UserInfoClient(userInfoEndpoint); userInfoClient2.setRequest(userInfoRequest2); UserInfoResponse response3 = userInfoClient2.exec(); UserInfoClient userInfoClient3 = new UserInfoClient(userInfoEndpoint); userInfoClient3.setRequest(userInfoRequest3); UserInfoResponse response4 = userInfoClient3.exec();
PrivateKey privateKey = cryptoProvider.getPrivateKey(keyId); UserInfoClient userInfoClient = new UserInfoClient(userInfoEndpoint); userInfoClient.setPrivateKey(privateKey); UserInfoResponse userInfoResponse = userInfoClient.execUserInfo(accessToken);
@Test public void requestUserInfoInvalidRequest() throws Exception { showTitle("requestUserInfoInvalidRequest"); UserInfoClient userInfoClient = new UserInfoClient(userInfoEndpoint); UserInfoResponse response = userInfoClient.execUserInfo(null); showClient(userInfoClient); assertEquals(response.getStatus(), 400, "Unexpected response code: " + response.getStatus()); assertNotNull(response.getErrorType(), "Unexpected result: errorType not found"); assertNotNull(response.getErrorDescription(), "Unexpected result: errorDescription not found"); }