
DanielK.66823 (Customer) asked a question.
- spring: security: oauth2: client: registration: okta: client-id: '11111111111111111111' client-secret: '000011112222333344445555666677778888AAAA' authorization-grant-type: authorization_code redirect-uri-template: 'http://localhost:8080/login/oauth2/code/okta' scope: - openid - profile - email provider: okta: authorization-uri: 'https://myapp.oktapreview.com/oauth2/aaaabbbbccccddddeeee/v1/authorize' token-uri: 'https://myapp.oktapreview.com/oauth2/aaaabbbbccccddddeeee/v1/token' user-info-uri: 'https://myapp.oktapreview.com/oauth2/aaaabbbbccccddddeeee/v1/userinfo' jwk-set-uri: 'https://myapp.oktapreview.com/oauth2/aaaabbbbccccddddeeee/v1/keys'
My issue is as follows: I need to make a request to the /userinfo endpoint, so I'm supplying the bearer token gathered through the login process. That doesn't work as the /userinfo endpoint always gives me a 401 Unauthorized response.Looking into it this error response seems correct to me as the issue at hand is obviously my token. The token doesn't seem to come from the configured authorization servers as I looked at the decoded JWT and the audience didn't match (another indicator was the expiration time which didn't match the configuration of the authorization server).But the audience parameter matched the authentication configuration within the application configuration (configuration tab "Sign On"). Question 1: Why don't I get a token matching the authorization servers even though I only authorize against this server?Question 2: Is there any other sensible way that allows me to make a request to the /userinfo endpoint? Best regardsDaniel Kasmeroglu