# Get GitHub token for user

**URL:** <https://community.auth0.com/t/get-github-token-for-user/6210>\
**Category:** Get Help\
**Tags:** github, access-token, user-creation\
**Created:** [April 13, 2017, 10:44pm UTC](https://community.auth0.com/t/get-github-token-for-user/6210 "2017-04-13T22:44:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sitapati](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/sitapati/32/7100_2.png) [@sitapati](https://community.auth0.com/u/sitapati)\
**Post date:** [April 13, 2017, 10:44pm UTC](https://community.auth0.com/t/get-github-token-for-user/6210/1 "2017-04-13T22:44:21Z")

</div>

I want to use the Hosted Lock page, and have a user log in via GitHub. I’ve got that working.

The part that isn’t working is where the user has a GitHub token stored against their user profile that I can use to perform operations on their behalf.

How do I have the Hosted Lock page receive a GitHub token and add it to the user record?

---

<div class="post-metadata">

**Author:** ![Logan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/logan/32/6078_2.png) [@Logan](https://community.auth0.com/u/Logan)\
**Post date:** [April 14, 2017, 3:10am UTC](https://community.auth0.com/t/get-github-token-for-user/6210/2 "2017-04-14T03:10:21Z")

</div>

I believe that these two documents can point you in the right direction:

- Call an Identity Provider API [https://auth0.com/docs/tutorials/calling-an-external-idp-api](https://auth0.com/docs/tutorials/calling-an-external-idp-api)
- Identity Provider Access Tokens [https://auth0.com/docs/tokens/idp](https://auth0.com/docs/tokens/idp)

Then, you should be able to use the Github access token under `user.identities[0].access_token`.

Note this advice may be out of date. Originally answered by @abhishek.hingnikar in old forums: [https://auth0.com/forum/t/hubspot-not-quite-oauth-connection/3644/7?u=logan](https://auth0.com/forum/t/hubspot-not-quite-oauth-connection/3644/7?u=logan)

---

<div class="post-metadata">

**Author:** ![jesper](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@jesper](https://community.auth0.com/u/jesper)\
**Post date:** [October 28, 2017, 2:11am UTC](https://community.auth0.com/t/get-github-token-for-user/6210/3 "2017-10-28T02:11:08Z")

</div>

I’m having this exact problem.

Is there any way to actually do this? I’m using swift on iOS and desperately trying to get a token with any other scope than “openid profile”. I’ve read all your documentation, and tried all your examples. None of it work. None of it.

This still returns a “openid profile” scoped token:

```
Auth0
            .webAuth()
            .scope("openid profile read:user_idp_tokens")
            .audience("https://kodapp.auth0.com/userinfo")
            .start {

```

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 2, 2018, 5:53am UTC](https://community.auth0.com/t/get-github-token-for-user/6210/4 "2018-03-02T05:53:15Z")

</div>


