
PradeepK.78700 (Customer) asked a question.
I have configured the OAuth2 client application using Okta and working through the `Authorization_code` grant flow. The application is able to get the `auth code` and the token, but trying to hit the userinfo endpoint and getting a 401 error when I have specified the `user-info-uri`.
I have enabled debug for `org.springframework.security` package but not getting much details. Where am I going wrong?
Update: I am getting this error when I have the `user-info-uri` property in the configuration and if removed, the endpoint is accessible.
`application.yml`
```
server:
port: 8555
spring:
security:
oauth2:
client:
registration:
okta:
client-id: masked
client-secret: masked
provider:
okta:
authorization-uri: https://domain/oauth2/default/v1/authorize
token-uri: https://domain/oauth2/default/v1/token
user-info-uri: https://domain/oauth2/v1/userinfo
jwk-set-uri: https://domain/oauth2/default/v1/keys
debug: true
logging:
level:
org.springframework.security: debug
```
`ApplicationConfiguration.java`
```
@Configuration
public class ApplicationSecurityConfiguration extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests()
.anyRequest()
.authenticated()
.and()
.oauth2Login();
}
}
```

Hello @pradeed kumar
I hope you are having a great day
thank you for reach us to help you in this implementation, according to your scenario, the best way to proceed would be engage our support team using the link below so they can check the reasons for this problem and determine the best solution for your implementation.
you can contact our support team, using the information found in the following link:
https://support.okta.com/help/s/article/Mac-Devices-showing-as-unmanaged?language=en_US
Have a great day ahead
Regards
Henry Esquivel
Okta Inc