org.springframework.security.oauth2.client.resource.OAuth2AccessDeniedException

tip

Check if your path is correct, if it's correct already you have to register your path to the mapping configuration.


rafaelrafael

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • OAuth2AccessDeniedException
    via GitHub by arnaudruffin
    ,
  • Cannot connect to Bluemix CF
    via GitHub by lucaverderame
    ,
  • spring-security
    via by Unknown author,
    • org.springframework.security.oauth2.client.resource.OAuth2AccessDeniedException: Error requesting access token. at org.springframework.security.oauth2.client.token.OAuth2AccessTokenSupport.retrieveToken(OAuth2AccessTokenSupport.java:145)[spring-security-oauth2-2.0.9.RELEASE.jar!/:na] at org.springframework.security.oauth2.client.token.grant.password.ResourceOwnerPasswordAccessTokenProvider.obtainAccessToken(ResourceOwnerPasswordAccessTokenProvider.java:47)[spring-security-oauth2-2.0.9.RELEASE.jar!/:na] at org.springframework.security.oauth2.client.OAuth2RestTemplate.acquireAccessToken(OAuth2RestTemplate.java:221)[spring-security-oauth2-2.0.9.RELEASE.jar!/:na] at org.springframework.security.oauth2.client.OAuth2RestTemplate.getAccessToken(OAuth2RestTemplate.java:173)[spring-security-oauth2-2.0.9.RELEASE.jar!/:na] at org.springframework.security.oauth2.client.OAuth2RestTemplate.createRequest(OAuth2RestTemplate.java:105)[spring-security-oauth2-2.0.9.RELEASE.jar!/:na] at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:592)[spring-web-4.2.5.RELEASE.jar!/:4.2.5.RELEASE] at org.springframework.security.oauth2.client.OAuth2RestTemplate.doExecute(OAuth2RestTemplate.java:128)[spring-security-oauth2-2.0.9.RELEASE.jar!/:na] at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:572)[spring-web-4.2.5.RELEASE.jar!/:4.2.5.RELEASE] at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:280)[spring-web-4.2.5.RELEASE.jar!/:4.2.5.RELEASE] at org.cloudfoundry.spring.util.AbstractSpringOperations.lambda$get$3(AbstractSpringOperations.java:85)[cloudfoundry-client-spring-2.0.0.M4.jar!/:2.0.0.M4] at org.cloudfoundry.spring.util.AbstractSpringOperations.lambda$null$1(AbstractSpringOperations.java:66)[cloudfoundry-client-spring-2.0.0.M4.jar!/:2.0.0.M4] at reactor.core.publisher.FluxYieldingEmitter$YieldingSignalEmitter.request(FluxYieldingEmitter.java:75)[reactor-core-2.5.0.M3.jar!/:na] at reactor.core.util.DeferredSubscription.set(DeferredSubscription.java:71)[reactor-core-2.5.0.M3.jar!/:na] at reactor.core.publisher.FluxSubscribeOn$SubscribeOnPipeline.onSubscribe(FluxSubscribeOn.java:129)[reactor-core-2.5.0.M3.jar!/:na] at reactor.core.subscriber.SignalEmitter.start(SignalEmitter.java:170)[reactor-core-2.5.0.M3.jar!/:na] at reactor.core.publisher.FluxYieldingEmitter.subscribe(FluxYieldingEmitter.java:43)[reactor-core-2.5.0.M3.jar!/:na] at reactor.core.publisher.FluxFlatMap.trySubscribeScalarMap(FluxFlatMap.java:153)[reactor-core-2.5.0.M3.jar!/:na] at reactor.core.publisher.FluxFlatMap.subscribe(FluxFlatMap.java:170)[reactor-core-2.5.0.M3.jar!/:na] at reactor.core.publisher.FluxSubscribeOn$SourceSubscribeTask.run(FluxSubscribeOn.java:363)[reactor-core-2.5.0.M3.jar!/:na] at reactor.core.publisher.Computations$ProcessorWorker.onNext(Computations.java:919)[reactor-core-2.5.0.M3.jar!/:na] at reactor.core.publisher.Computations$ProcessorWorker.onNext(Computations.java:883)[reactor-core-2.5.0.M3.jar!/:na] at reactor.core.publisher.WorkQueueProcessor$QueueSubscriberLoop.run(WorkQueueProcessor.java:842)[reactor-core-2.5.0.M3.jar!/:na] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[na:1.8.0_91] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[na:1.8.0_91] at java.lang.Thread.run(Thread.java:745)[na:1.8.0_91] Caused by: org.springframework.web.client.HttpClientErrorException: 401 Unauthorized at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:91)[spring-web-4.2.5.RELEASE.jar!/:4.2.5.RELEASE] at org.springframework.security.oauth2.client.token.OAuth2AccessTokenSupport$AccessTokenErrorHandler.handleError(OAuth2AccessTokenSupport.java:244)[spring-security-oauth2-2.0.9.RELEASE.jar!/:na] at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:641)[spring-web-4.2.5.RELEASE.jar!/:4.2.5.RELEASE] at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:597)[spring-web-4.2.5.RELEASE.jar!/:4.2.5.RELEASE] at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:565)[spring-web-4.2.5.RELEASE.jar!/:4.2.5.RELEASE] at org.springframework.security.oauth2.client.token.OAuth2AccessTokenSupport.retrieveToken(OAuth2AccessTokenSupport.java:137)[spring-security-oauth2-2.0.9.RELEASE.jar!/:na] ... 24 more

    Users with the same issue

    TahirTahir
    1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    118 more bugmates