本文整理了Java中org.springframework.security.oauth2.client.resource.OAuth2AccessDeniedException.getCause()
方法的一些代码示例,展示了OAuth2AccessDeniedException.getCause()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。OAuth2AccessDeniedException.getCause()
方法的具体详情如下:
包路径:org.springframework.security.oauth2.client.resource.OAuth2AccessDeniedException
类名称:OAuth2AccessDeniedException
方法名:getCause
暂无
代码示例来源:origin: spring-projects/spring-security-oauth
Throwable cause = e.getCause();
if (cause instanceof RuntimeException) {
throw (RuntimeException) cause;
代码示例来源:origin: spring-projects/spring-security-oauth
@Test
@OAuth2ContextConfiguration(value=ResourceOwner.class, initialize=false)
public void testTokenEndpointWrongPassword() throws Exception {
ResourceOwnerPasswordResourceDetails resource = (ResourceOwnerPasswordResourceDetails) context
.getResource();
resource.setPassword("bogus");
try {
new OAuth2RestTemplate(resource).getAccessToken();
} catch (OAuth2AccessDeniedException e) {
String summary = ((OAuth2Exception)e.getCause()).getSummary();
assertTrue("Wrong summary: " + summary, summary.contains("Bad credentials"));
}
}
代码示例来源:origin: org.springframework.security.oauth/spring-security-oauth2
Throwable cause = e.getCause();
if (cause instanceof RuntimeException) {
throw (RuntimeException) cause;
代码示例来源:origin: spring-cloud/spring-cloud-dataflow
if (e.getCause() instanceof ResourceAccessException) {
final String errorMessage = String.format(
"While authenticating user '%s': " + "Unable to access accessTokenUri '%s'.", username,
accessTokenUri);
logger.error(errorMessage + " Error message: {}.", e.getCause().getMessage());
throw new AuthenticationServiceException(errorMessage, e);
代码示例来源:origin: org.springframework.cloud/spring-cloud-dataflow-server-core
if (e.getCause() instanceof ResourceAccessException) {
final String errorMessage = String.format(
"While authenticating user '%s': " + "Unable to access accessTokenUri '%s'.", username,
accessTokenUri);
logger.error(errorMessage + " Error message: {}.", e.getCause().getMessage());
throw new AuthenticationServiceException(errorMessage, e);
代码示例来源:origin: org.springframework.cloud/spring-cloud-common-security-config-web
if (e.getCause() instanceof ResourceAccessException) {
final String errorMessage = String.format(
"While authenticating user '%s': " + "Unable to access accessTokenUri '%s'.", username,
accessTokenUri);
logger.error(errorMessage + " Error message: {}.", e.getCause().getMessage());
throw new AuthenticationServiceException(errorMessage, e);
内容来源于网络,如有侵权,请联系作者删除!