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

**URL:** <https://devforum.okta.com/t/how-to-access-api-v1-users-me-from-okta-angular-serivice/4363>\
**Category:** Questions\
**Created:** [March 2, 2019, 7:59pm UTC](https://devforum.okta.com/t/how-to-access-api-v1-users-me-from-okta-angular-serivice/4363 "2019-03-02T19:59:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dben41](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/dben41/32/963_2.png) [@dben41](https://devforum.okta.com/u/dben41)\
**Post date:** [March 2, 2019, 7:59pm UTC](https://devforum.okta.com/t/how-to-access-api-v1-users-me-from-okta-angular-serivice/4363/1 "2019-03-02T19:59:55Z")

</div>

I followed this tutorial `https://developer.okta.com/quickstart/#/angular/dotnet/aspnetcore`, 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

---

<div class="post-metadata">

**Author:** ![mraible](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/mraible/32/37_2.png) [@mraible](https://devforum.okta.com/u/mraible)\
**Post date:** [March 2, 2019, 10:11pm UTC](https://devforum.okta.com/t/how-to-access-api-v1-users-me-from-okta-angular-serivice/4363/2 "2019-03-02T22:11:11Z")

</div>

If you’re using the Angular SDK on our client, you might try using [`oktaAuth.getUser()`](https://github.com/okta/okta-oidc-js/tree/master/packages/okta-angular#oktaauthgetuser).

---

<div class="post-metadata">

**Author:** ![dragos](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/dragos/32/1313_2.png) [@dragos](https://devforum.okta.com/u/dragos)\
**Post date:** [March 4, 2019, 2:49pm UTC](https://devforum.okta.com/t/how-to-access-api-v1-users-me-from-okta-angular-serivice/4363/3 "2019-03-04T14:49:49Z")

</div>

Hi @dben41

Please make sure that you are also sending withCredentials xhr attribute, as per the examples provided [here](https://developer.okta.com/docs/api/getting_started/enabling_cors#request-examples).

---

<div class="post-metadata">

**Author:** ![dben41](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/dben41/32/963_2.png) [@dben41](https://devforum.okta.com/u/dben41)\
**Post date:** [March 4, 2019, 4:50pm UTC](https://devforum.okta.com/t/how-to-access-api-v1-users-me-from-okta-angular-serivice/4363/4 "2019-03-04T16:50:59Z")

</div>

@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!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/oktadev/original/1X/589c4c5f80de422d01f47cee7185a7fb8227835c.png) [@system](https://devforum.okta.com/u/system)\
**Post date:** [January 17, 2024, 7:46pm UTC](https://devforum.okta.com/t/how-to-access-api-v1-users-me-from-okta-angular-serivice/4363/5 "2024-01-17T19:46:29Z")

</div>

Closed on January 17, 2024, 7:46pm UTC

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