How to access /api/v1/users/me from Okta Angular Serivice

I followed this tutorial, and it is working just fine. But, the oktaAuthService.getUser doesn’t have all the fields I need. I’d just rather make a GET request to {baseUrl}/api/v1/users/me, because that has the fields I need. This works in the browser, but not on my client. I get a CORS issue, although my URL is a trusted domain in Okta, and I think that the token is different. I get a Invalid Session error. 403 forbidden. How do I access the {baseUrl}/api/v1/users/me API?

I’m using Okta as an Auth server, and my app redirects to the Okta hosted page

If you’re using the Angular SDK on our client, you might try using oktaAuth.getUser().

Hi @dben41

Please make sure that you are also sending withCredentials xhr attribute, as per the examples provided here.

@mraible thanks for the tip, but the oktaAuth.getUser() doesn’t have all the fields I need. I need managerId and departmentId, neither which is foudn on the getUser() method.

@dragos thanks for the advice, I will look at the link that you provided!