# Get Access Token with Refresh Token using PKCE flow

**URL:** <https://devforum.okta.com/t/get-access-token-with-refresh-token-using-pkce-flow/15884>\
**Category:** Questions\
**Created:** [September 2, 2021, 8:17am UTC](https://devforum.okta.com/t/get-access-token-with-refresh-token-using-pkce-flow/15884 "2021-09-02T08:17:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hekmil](https://avatars.discourse-cdn.com/v4/letter/h/e47774/32.png) [@Hekmil](https://devforum.okta.com/u/Hekmil)\
**Post date:** [September 2, 2021, 8:17am UTC](https://devforum.okta.com/t/get-access-token-with-refresh-token-using-pkce-flow/15884/1 "2021-09-02T08:17:20Z")

</div>

Hi,

I’m having trouble to refresh my Access Token using a Refresh Token using the PKCE flow.

I’m using the @okta/okta-auth-js for React and I’m looking for a way to renew Access Token on specific action. I was thinking of using the Refresh Token for that but I can’t find a function to use it with the lib. Also the `token.renew(tokenToRenew)` does not work I’m getting the error :

```auto
Browser requests to the token endpoint may only use the authorization_code grant_type.

```

Thanks

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [September 2, 2021, 3:13pm UTC](https://devforum.okta.com/t/get-access-token-with-refresh-token-using-pkce-flow/15884/2 "2021-09-02T15:13:21Z")

</div>

And you’re definitely using a SPA configured for PKCE flow when you see this error?

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [September 3, 2021, 3:16pm UTC](https://devforum.okta.com/t/get-access-token-with-refresh-token-using-pkce-flow/15884/3 "2021-09-03T15:16:29Z")

</div>


