Examples of UriBuilder


Examples of org.springframework.security.oauth2.provider.ServerRunning.UriBuilder

    String scope = "bogus";
    String redirectUri = "http://anywhere?key=value";
    String clientId = "my-client-with-registered-redirect";

    UriBuilder uri = serverRunning.buildUri("/sparklr2/oauth/authorize").queryParam("response_type", "code")
        .queryParam("state", "mystateid").queryParam("scope", scope);
    if (clientId != null) {
      uri.queryParam("client_id", clientId);
    }
    if (redirectUri != null) {
      uri.queryParam("redirect_uri", redirectUri);
    }
    ResponseEntity<String> response = serverRunning.getForString(uri.pattern(), headers, uri.params());
    assertEquals(HttpStatus.FOUND, response.getStatusCode());
    String location = response.getHeaders().getLocation().toString();
    assertTrue(location.startsWith("http://anywhere"));
    assertTrue(location.contains("error=invalid_scope"));
    assertFalse(location.contains("redirect_uri="));
View Full Code Here

Examples of org.springframework.social.support.URIBuilder

      @RequestParam("error") String error,
      @RequestParam(value="error_description", required=false) String errorDescription,
      @RequestParam(value="error_uri", required=false) String errorUri,
      NativeWebRequest request) {
    logger.warn("Error during authorization: " + error);
    URIBuilder uriBuilder = URIBuilder.fromUri(signInUrl).queryParam("error", error);
    if (errorDescription != null ) { uriBuilder.queryParam("error_description", errorDescription); }
    if (errorUri != null ) { uriBuilder.queryParam("error_uri", errorUri); }
    return redirect(uriBuilder.build().toString());
  }
View Full Code Here

Examples of sparklr.common.HttpTestUtils.UriBuilder

      HttpHeaders headers = getAuthenticatedHeaders();
      return http.getForString(getAuthorizeUrl(clientId, redirectUri, responseType, "read"), headers);
  }

  private String getAuthorizeUrl(String clientId, String redirectUri, String responseType, String scope) {
      UriBuilder uri = http.buildUri(authorizePath()).queryParam("state", "mystateid").queryParam("scope", scope);
      if (responseType != null) {
          uri.queryParam("response_type", responseType);
      }
      if (clientId != null) {
          uri.queryParam("client_id", clientId);
      }
      if (redirectUri != null) {
          uri.queryParam("redirect_uri", redirectUri);
      }
      return uri.build().toString();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.