# Selfhosted widget - API integration

**URL:** <https://devforum.okta.com/t/selfhosted-widget-api-integration/12888>\
**Category:** Questions\
**Tags:** widget\
**Created:** [February 11, 2021, 4:47pm UTC](https://devforum.okta.com/t/selfhosted-widget-api-integration/12888 "2021-02-11T16:47:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![arung86](https://avatars.discourse-cdn.com/v4/letter/a/46a35a/32.png) [@arung86](https://devforum.okta.com/u/arung86)\
**Post date:** [February 11, 2021, 4:47pm UTC](https://devforum.okta.com/t/selfhosted-widget-api-integration/12888/1 "2021-02-11T16:47:27Z")

</div>

Hi  
Using self hosted widget login, I am unable to get the userId of the current logged in user,  
so that I can use those details for integrating other user related API  
I am able to get the userinfo which does not have id field in it, and I have got the access token required for API.

---

<div class="post-metadata">

**Author:** ![gpadma](https://avatars.discourse-cdn.com/v4/letter/g/858c86/32.png) [@gpadma](https://devforum.okta.com/u/gpadma)\
**Post date:** [February 11, 2021, 5:09pm UTC](https://devforum.okta.com/t/selfhosted-widget-api-integration/12888/2 "2021-02-11T17:09:03Z")

</div>

Hi @arung86,

sub claim in id token and userinfo response would refer to the userid. See the [example](https://developer.okta.com/docs/reference/api/oidc/#response-example-success-5) here.

---

<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 26, 2024, 6:54pm UTC](https://devforum.okta.com/t/selfhosted-widget-api-integration/12888/3 "2024-01-26T18:54:07Z")

</div>

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