# Authorization Code Flow with PKCE

**URL:** <https://community.auth0.com/t/authorization-code-flow-with-pkce/50203>\
**Category:** Get Help\
**Tags:** pkce\
**Created:** [September 22, 2020, 1:06pm UTC](https://community.auth0.com/t/authorization-code-flow-with-pkce/50203 "2020-09-22T13:06:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tma](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/tma/32/13269_2.png) [@tma](https://community.auth0.com/u/tma)\
**Post date:** [September 22, 2020, 1:06pm UTC](https://community.auth0.com/t/authorization-code-flow-with-pkce/50203/1 "2020-09-22T13:06:09Z")

</div>

I’m using this resource to get my auth flow working:

> **[Call Your API Using the Authorization Code Flow with PKCE - Auth0 Docs](https://auth0.com/docs/get-started/authentication-and-authorization-flow/authorization-code-flow-with-pkce/call-your-api-using-the-authorization-code-flow-with-pkce)**
>
> Learn how to call your API from a native, mobile, or single-page application using the Authorization Code flow using Proof Key for Code Exchange (PKCE).

When I send the Auth request, the user is redirected to the login page. Is there a recommended way to store the code\_verifier while the redirect happens? Local storage? Cookie?

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [September 22, 2020, 1:53pm UTC](https://community.auth0.com/t/authorization-code-flow-with-pkce/50203/2 "2020-09-22T13:53:29Z")

</div>

Per the possible storage types you mentioned I’m assuming this is a SPA so one possibility could be to use an higher-level SDK and leave that detail for the SDK. I think the Auth0 SPA SDK ([Auth0 Single Page App SDK](https://auth0.com/docs/libraries/auth0-single-page-app-sdk)) uses cookies as the default storage mechanism for such data.

One advantage of cookies is that you can get automatic cleanup done by the browser for cases where a login request may be abandoned by the user.

---

<div class="post-metadata">

**Author:** ![tma](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/tma/32/13269_2.png) [@tma](https://community.auth0.com/u/tma)\
**Post date:** [September 23, 2020, 3:52pm UTC](https://community.auth0.com/t/authorization-code-flow-with-pkce/50203/3 "2020-09-23T15:52:57Z")

</div>

Thanks! I’ll go for the cookie for now.

---

<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:** [October 8, 2020, 3:52pm UTC](https://community.auth0.com/t/authorization-code-flow-with-pkce/50203/4 "2020-10-08T15:52:58Z")

</div>

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