Hi,
I’m trying to access the user information of the user logged in using OAuth bearer tokens but it always returns nil for some reason.
This is my OAuth config on my server:
oktaOauthConfig = &oauth2.Config{
RedirectURL: opts.DomainName + "/authorization-code/callback",
ClientID: mustLoadToken(opts.OktaOauthClientIDFile),
ClientSecret: mustLoadToken(opts.OktaOauthClientSecretFile),
Scopes: []string{},
Endpoint: oauth2.Endpoint{
AuthURL: opts.OktaOauthIssuer + "/v1/authorize",
TokenURL: opts.OktaOauthIssuer + "/v1/token",
AuthStyle: oauth2.AuthStyleInParams,
},
}
and this is the GET request I make
API URL: https://${my_company}.okta.com/api/v1/users/me
Header:
Content-Type:application/json
Authorization:Bearer ${{access_token}}
and this is my applications Okta API Scopes (not sure how these actually work):
What am I missing or what do I need to do to make the API not return nil? Any information would be massively appreciated