# How to get access token, working algorithm

**URL:** <https://devforum.okta.com/t/how-to-get-access-token-working-algorithm/11553>\
**Category:** Questions\
**Created:** [October 29, 2020, 3:41pm UTC](https://devforum.okta.com/t/how-to-get-access-token-working-algorithm/11553 "2020-10-29T15:41:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Master\_Sergius](https://avatars.discourse-cdn.com/v4/letter/m/ed8c4c/32.png) [@Master\_Sergius](https://devforum.okta.com/u/Master_Sergius)\
**Post date:** [October 29, 2020, 3:41pm UTC](https://devforum.okta.com/t/how-to-get-access-token-working-algorithm/11553/1 "2020-10-29T15:41:08Z")

</div>

Hi all,

I’m new here and I need your help 🙂

I’ve searched through docs and threads like [Get an access token manually for testing](https://devforum.okta.com/t/get-an-access-token-manually-for-testing/1646/5) and I can’t get access token.  
I’ve tried to construct the following uri and use browser:

[https://dev-4942226.okta.com/oauth2/v1/authorize?client\_id=\<my\_client\_id\>&response\_type=token&response\_mode=fragment&scope=okta.users.read&redirect\_uri=http://localhost:5000/oidc/callback&nonce=UBGW&state=1234](https://dev-4942226.okta.com/oauth2/v1/authorize?client_id=%3Cmy_client_id%3E&response_type=token&response_mode=fragment&scope=okta.users.read&redirect_uri=http://localhost:5000/oidc/callback&nonce=UBGW&state=1234)  
My flask app is required to be running, but I get bad request errors anyway.

So, looks like access token connected to particular app that I’ve created, like client id/secret? So, it’s not kind of general password to account?  
And what are the real working steps to get access token?  
i.e.:

1. curl \<some\_url\> -d \<some\_payload\>
2. curl \<some\_another\_url\> -d \<some\_another\_payload\>

I tried to use debugging redirect uri and run again with browser:

 ![Screenshot 2020-10-29 at 18.23.35](https://global.discourse-cdn.com/oktadev/original/2X/6/6b667c7e464c734df898119ddfb7720e6feec3bb.png)  
but it fails with the following error:  
 ![Screenshot 2020-10-29 at 18.23.18](https://global.discourse-cdn.com/oktadev/original/2X/3/38bb3a3b304cdd74eb9d667dd4c3e45efe901688.png)

---

<div class="post-metadata">

**Author:** ![dzeller](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/dzeller/32/2790_2.png) [@dzeller](https://devforum.okta.com/u/dzeller)\
**Post date:** [October 29, 2020, 4:40pm UTC](https://devforum.okta.com/t/how-to-get-access-token-working-algorithm/11553/2 "2020-10-29T16:40:10Z")

</div>

Hi @Master_Sergius, you will need to go to the “Okta API Scopes” tab and allow your app to be granted the scope that you are trying to request (okta.users.read)

---

<div class="post-metadata">

**Author:** ![Master\_Sergius](https://avatars.discourse-cdn.com/v4/letter/m/ed8c4c/32.png) [@Master\_Sergius](https://devforum.okta.com/u/Master_Sergius)\
**Post date:** [October 29, 2020, 4:45pm UTC](https://devforum.okta.com/t/how-to-get-access-token-working-algorithm/11553/3 "2020-10-29T16:45:13Z")

</div>

Holy Moly! That worked, finally after many hours of googling and trying! Why it is so complicated and not obvious? Is there any working guide on okta site?

---

<div class="post-metadata">

**Author:** ![dzeller](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/dzeller/32/2790_2.png) [@dzeller](https://devforum.okta.com/u/dzeller)\
**Post date:** [October 29, 2020, 4:58pm UTC](https://devforum.okta.com/t/how-to-get-access-token-working-algorithm/11553/4 "2020-10-29T16:58:50Z")

</div>

You can find guides on [developer.okta.com](http://developer.okta.com), here is an guide walking through how to use OAuth Bearer tokens for Okta’s APIs [https://developer.okta.com/docs/guides/implement-oauth-for-okta/overview/](https://developer.okta.com/docs/guides/implement-oauth-for-okta/overview/)

---

<div class="post-metadata">

**Author:** ![Master\_Sergius](https://avatars.discourse-cdn.com/v4/letter/m/ed8c4c/32.png) [@Master\_Sergius](https://devforum.okta.com/u/Master_Sergius)\
**Post date:** [October 29, 2020, 5:05pm UTC](https://devforum.okta.com/t/how-to-get-access-token-working-algorithm/11553/5 "2020-10-29T17:05:41Z")

</div>

Thank you. Btw, it turned out this access token which I got is not signed with JWK, why?

---

<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:** [October 30, 2020, 5:05pm UTC](https://devforum.okta.com/t/how-to-get-access-token-working-algorithm/11553/6 "2020-10-30T17:05:48Z")

</div>

Closed on October 30, 2020, 5:05pm UTC

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