Unable to obtain new access token for resource 'null'

Hello,
I have two spring boot 2.1.8 services running, one configured as @EnableOAuth2Client and acting as a client providing authentication and retrieving access tokens. The other setup as a resource server using Okta service.

The client yml contains:

spring:
security:
oauth2:
client:
registration:
okta:
client-id: xxxx
client-secret: xxxx
- openid
- profile
- email
provider:
okta:
authorization-uri: https://xxxx/oauth2/v1/authorize
token-uri: https://xxxx/oauth2/v1/token
user-info-uri: https://xxxx/oauth2/v1/userinfo
user-name-attribute: sub
jwk-set-uri: https://xxx/oauth2/v1/keys

I am using RestTemplate from the client to consume an external API. The relevant code looks like:

Any suggestions about why this is happening please?
Regards and Thanks

Spring Security 5.1 ships with Spring Boot 2.1.x and no longer users the @Enable annotations to configure oauth2Login, oauth2Client, nor resource server. We wrote a blog post that should help you migrate.

Thank you, I’ll take a look at the post. Any thoughts about what is causing the error based on the configuration I’m using? I’ll remove any unneeded annotations.

I can see there is a lot of change between spring security versions. I’ll spend some time this weekend updating the configuration. Many thanks again for your assistance and have a great weekend!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.