# Auth0.js SDK - Does it support PKCE?

**URL:** <https://community.auth0.com/t/auth0-js-sdk-does-it-support-pkce/62433>\
**Category:** Get Help\
**Tags:** login\
**Created:** [May 8, 2021, 11:13am UTC](https://community.auth0.com/t/auth0-js-sdk-does-it-support-pkce/62433 "2021-05-08T11:13:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![roy1](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/roy1/32/25065_2.png) [@roy1](https://community.auth0.com/u/roy1)\
**Post date:** [May 8, 2021, 11:13am UTC](https://community.auth0.com/t/auth0-js-sdk-does-it-support-pkce/62433/1 "2021-05-08T11:13:48Z")

</div>

Given you want create self hosted custom login UI for any reason that is out of your control. I think for this scenario you have to use auth0.js SDK. Does it support PKCE? I would not like to use Implicit Flow. The documentation does not mention it…

> **[auth0-js](https://www.npmjs.com/package/auth0-js)**
>
> Auth0 headless browser sdk. Latest version: 9.20.1, last published: 12 days ago. Start using auth0-js in your project by running \`npm i auth0-js\`. There are 420 other projects in the npm registry using auth0-js.

> **[Auth0.js v9 Reference](https://auth0.com/docs/libraries/auth0js)**
>
> How to install, initialize and use auth0.js v9

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [May 10, 2021, 7:31am UTC](https://community.auth0.com/t/auth0-js-sdk-does-it-support-pkce/62433/2 "2021-05-10T07:31:33Z")

</div>

Hey there!

Unfortunately this one no but auth0-spa-js yes.

> **[Auth0 Single Page App SDK](https://auth0.com/docs/libraries/auth0-single-page-app-sdk)**
>
> Auth0 SDK for single page applications using Authorization Code Grant Flow with PKCE.

---

<div class="post-metadata">

**Author:** ![roy1](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/roy1/32/25065_2.png) [@roy1](https://community.auth0.com/u/roy1)\
**Post date:** [May 10, 2021, 8:16am UTC](https://community.auth0.com/t/auth0-js-sdk-does-it-support-pkce/62433/3 "2021-05-10T08:16:48Z")

</div>

> [@roy1](#):
>
> Given you want create self hosted custom login UI for any reason that is out of your control.

Hello okay, just to be on the safe side → with auth0-spa-js SDK, is it possibile to so create self hosted custom login UI?

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [May 10, 2021, 9:34am UTC](https://community.auth0.com/t/auth0-js-sdk-does-it-support-pkce/62433/4 "2021-05-10T09:34:23Z")

</div>

More on that here:

> <https://github.com/auth0/auth0-spa-js/issues/214>
>
> Is it possible to use the 'Authorization Code Flow with PKCE' using a custom sel…f-hosted login form where i just call a login function with the username and password (just as in the Auth0.js SDK)? As far as i can see this only works with Universal Login, but maybe i'm missing something. 
> 
> Right now i integrated the regular 'Authorization Code Flow' in this way using the Auth0.js SDK but there is no option to pass in a code\_challenge when logging in.
> 
> Any help?
> 
> Thanks,
> Daan

---

<div class="post-metadata">

**Author:** ![roy1](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/roy1/32/25065_2.png) [@roy1](https://community.auth0.com/u/roy1)\
**Post date:** [May 14, 2021, 5:36am UTC](https://community.auth0.com/t/auth0-js-sdk-does-it-support-pkce/62433/5 "2021-05-14T05:36:16Z")

</div>

Hi again! I was also investing for creating with our React SPA app a PKCE flow with raw Auth0 authentication API [Add Login Using the Authorization Code Flow with PKCE](https://auth0.com/docs/flows/add-login-using-the-authorization-code-flow-with-pkce) is it also possible to do with this approach? Moreover can you have self hosted Login UI with that approach?

---

<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:** [May 29, 2021, 5:36am UTC](https://community.auth0.com/t/auth0-js-sdk-does-it-support-pkce/62433/6 "2021-05-29T05:36:51Z")

</div>

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