Examples of InvalidClientException


Examples of org.springframework.security.oauth2.common.exceptions.InvalidClientException

  }

  @Test
  public void readValueInvalidClient() throws Exception {
    String accessToken = createResponse(OAuth2Exception.INVALID_CLIENT);
    InvalidClientException result = (InvalidClientException) mapper.readValue(accessToken, OAuth2Exception.class);
    assertEquals(DETAILS,result.getMessage());
    assertEquals(null,result.getAdditionalInformation());
  }
View Full Code Here

Examples of org.springframework.security.oauth2.common.exceptions.InvalidClientException

  }

  @Test
  public void readValueWithAdditionalDetails() throws Exception {
    String accessToken = "{\"error\": \"invalid_client\", \"error_description\": \"some detail\", \"foo\": \"bar\"}";
    InvalidClientException result = (InvalidClientException) mapper.readValue(accessToken, OAuth2Exception.class);
    assertEquals(DETAILS,result.getMessage());
    assertEquals("{foo=bar}",result.getAdditionalInformation().toString());
  }
View Full Code Here

Examples of org.springframework.security.oauth2.common.exceptions.InvalidClientException

  private MockHttpServletResponse response = new MockHttpServletResponse();

  @Test
  public void testErrorPage() throws Exception {
    request.setContextPath("/foo");
    request.setAttribute("error", new InvalidClientException("FOO"));
    ModelAndView result = endpoint.handleError(request);
    result.getView().render(result.getModel(), request , response);
    String content = response.getContentAsString();
    assertTrue("Wrong content: " + content, content.contains("OAuth Error"));
    assertTrue("Wrong content: " + content, content.contains("invalid_client"));
View Full Code Here

Examples of org.springframework.security.oauth2.common.exceptions.InvalidClientException

    assertEquals(token, provider.obtainAccessToken(resource, request));
  }

  @Test
  public void testGetErrorFromJson() throws Exception {
    final InvalidClientException exception = new InvalidClientException("FOO");
    requestFactory = new ClientHttpRequestFactory() {
      public ClientHttpRequest createRequest(URI uri, HttpMethod httpMethod) throws IOException {
        return new StubClientHttpRequest(HttpStatus.BAD_REQUEST,
            new ObjectMapper().writeValueAsString(exception));
      }
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.