Examples of OAuth2Exception


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

    assertEquals(expected,mapper.writeValueAsString(oauthException));
  }

  @Test
  public void writeValueAsStringOAuth2Exception() throws Exception {
    oauthException = new OAuth2Exception(DETAILS);
    String expected = createResponse(oauthException.getOAuth2ErrorCode());
    assertEquals(expected,mapper.writeValueAsString(oauthException));
  }
View Full Code Here

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

  }

  @Test
  public void readValueUndefinedException() throws Exception {
    String accessToken = createResponse("notdefinedcode");
    OAuth2Exception result = 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.OAuth2Exception

  }

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

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

  @Override
  public ClientDetails loadClientByClientId(String appId) throws OAuth2Exception {
    try {
      return clientDetailsFor(appRepository.findAppByApiKey(appId));
    } catch (InvalidApiKeyException e) {
      throw new OAuth2Exception("Invalid OAuth App ID " + appId, e);
    }
  }
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.