.target(url.toString() + authorizePath + "?" + authorizationRequest.getQueryString()).request();
private AuthorizeClient processAuthentication(WebDriver currentDriver, String authorizeUrl, AuthorizationRequest authorizationRequest, String userId, String userSecret) { String authorizationRequestUrl = authorizeUrl + "?" + authorizationRequest.getQueryString(); AuthorizeClient authorizeClient = new AuthorizeClient(authorizeUrl); authorizeClient.setRequest(authorizationRequest); System.out.println("authenticateResourceOwnerAndGrantAccess: authorizationRequestUrl:" + authorizationRequestUrl); currentDriver.navigate().to(authorizationRequestUrl); if (userSecret != null) { if (userId != null) { WebElement usernameElement = currentDriver.findElement(By.name(loginFormUsername)); usernameElement.sendKeys(userId); } WebElement passwordElement = currentDriver.findElement(By.name(loginFormPassword)); passwordElement.sendKeys(userSecret); WebElement loginButton = currentDriver.findElement(By.name(loginFormLoginButton)); loginButton.click(); } return authorizeClient; }
.target(url.toString() + authorizePath + "?" + authorizationRequest.getQueryString()).request(); request.header("Accept", MediaType.TEXT_PLAIN);
.target(url.toString() + authorizePath + "?" + authorizationRequest.getQueryString()).request(); request.header("Authorization", "Basic " + authorizationRequest.getEncodedCredentials()); request.header("Accept", MediaType.TEXT_PLAIN);
.target(url.toString() + authorizePath + "?" + authorizationRequest.getQueryString()).request(); request.header("Authorization", "Basic " + authorizationRequest.getEncodedCredentials());
.target(url.toString() + authorizePath + "?" + authorizationRequest.getQueryString()).request(); request.header("Authorization", "Basic " + authorizationRequest.getEncodedCredentials());
.target(url.toString() + authorizePath + "?" + authorizationRequest.getQueryString()).request(); request.header("Authorization", "Basic " + authorizationRequest.getEncodedCredentials()); request.header("Accept", MediaType.TEXT_PLAIN);
.target(url.toString() + authorizePath + "?" + authorizationRequest.getQueryString()).request(); request.header("Authorization", "Basic " + authorizationRequest.getEncodedCredentials()); request.header("Accept", MediaType.TEXT_PLAIN);
final String redirectionUrl = this.openIdConfiguration.getAuthorizationEndpoint() + "?" + authorizationRequest.getQueryString(); logger.debug("oxAuth redirection Url: '{}'", redirectionUrl);
.target(url.toString() + authorizePath + "?" + authorizationRequest.getQueryString()).request(); request.header("Authorization", "Basic " + authorizationRequest.getEncodedCredentials()); request.header("Accept", MediaType.TEXT_PLAIN);
.target(url.toString() + authorizePath + "?" + authorizationRequest.getQueryString()).request(); request.header("Authorization", "Basic " + authorizationRequest.getEncodedCredentials()); request.header("Accept", MediaType.TEXT_PLAIN);
.target(url.toString() + authorizePath + "?" + authorizationRequest.getQueryString()).request(); request.header("Authorization", "Basic " + authorizationRequest.getEncodedCredentials()); request.header("Accept", MediaType.TEXT_PLAIN);
.target(url.toString() + authorizePath + "?" + authorizationRequest.getQueryString()).request(); request.header("Authorization", "Basic " + authorizationRequest.getEncodedCredentials()); request.header("Accept", MediaType.TEXT_PLAIN);
.target(url.toString() + authorizePath + "?" + authorizationRequest.getQueryString()).request(); request.header("Authorization", "Basic " + authorizationRequest.getEncodedCredentials()); request.header("Accept", MediaType.TEXT_PLAIN);
.target(url.toString() + authorizePath + "?" + authorizationRequest.getQueryString()).request(); request.header("Authorization", "Basic " + authorizationRequest.getEncodedCredentials()); request.header("Accept", MediaType.TEXT_PLAIN);
@Parameters({"authorizePath", "userId", "userSecret"}) @Test public void requestAuthorizationCodeFail1(final String authorizePath, final String userId, final String userSecret) throws Exception { // Testing with missing parameters AuthorizationRequest authorizationRequest = new AuthorizationRequest(null, null, null, null, null); authorizationRequest.setAuthUsername(userId); authorizationRequest.setAuthPassword(userSecret); Builder request = ResteasyClientBuilder.newClient() .target(url.toString() + authorizePath + "?" + authorizationRequest.getQueryString()).request(); request.header("Authorization", "Basic " + authorizationRequest.getEncodedCredentials()); request.header("Accept", MediaType.TEXT_PLAIN); Response response = request.get(); String entity = response.readEntity(String.class); showResponse("requestAuthorizationCodeFail1", response, entity); assertEquals(response.getStatus(), 400, "Unexpected response code."); assertNotNull(entity, "Unexpected result: " + entity); try { JSONObject jsonObj = new JSONObject(entity); assertTrue(jsonObj.has("error"), "The error type is null"); assertTrue(jsonObj.has("error_description"), "The error description is null"); } catch (JSONException e) { e.printStackTrace(); fail(e.getMessage() + "\nResponse was: " + entity); } }
.target(url.toString() + authorizePath + "?" + authorizationRequest.getQueryString()).request(); request.header("Authorization", "Basic " + authorizationRequest.getEncodedCredentials()); request.header("Accept", MediaType.TEXT_PLAIN);
String authorizationRequestUrl = authorizeUrl + "?" + authorizationRequest.getQueryString();
public AuthorizationResponse authorizationRequestAndDenyAccess( String authorizeUrl, AuthorizationRequest authorizationRequest) { String authorizationRequestUrl = authorizeUrl + "?" + authorizationRequest.getQueryString();
public AuthorizationResponse authorizationRequestAndGrantAccess( String authorizeUrl, AuthorizationRequest authorizationRequest) { String authorizationRequestUrl = authorizeUrl + "?" + authorizationRequest.getQueryString();