# Auth Code + PKCE. Secret VS No Secret?

**URL:** <https://community.auth0.com/t/auth-code-pkce-secret-vs-no-secret/61040>\
**Category:** Get Help\
**Tags:** pkce, jwt, auth0\
**Created:** [April 13, 2021, 7:00pm UTC](https://community.auth0.com/t/auth-code-pkce-secret-vs-no-secret/61040 "2021-04-13T19:00:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![VictorioBerra](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/victorioberra/32/28773_2.png) [@VictorioBerra](https://community.auth0.com/u/VictorioBerra)\
**Post date:** [April 13, 2021, 7:00pm UTC](https://community.auth0.com/t/auth-code-pkce-secret-vs-no-secret/61040/1 "2021-04-13T19:00:13Z")

</div>

Looking for a simple answer to this. SPAs and Clients with a back-end clients can both use Auth Code + PKCE. However, clients with a back-end use secrets (SPAs can’t be trusted to keep one).

[The official spec for Auth Code + PKCE says nothing about secrets](https://tools.ietf.org/html/rfc7636) and if/when they are required, unless I missed it completely. code\_verifier is a secret, but its not THE SECRET. Its not a secret generated and saved with Auth0.

So, is requiring a secret completely up to the IdP (Auth0)? The way I understand this, is that Auth0 will set a flag `RequireSecret = true` and thats the only thing that makes the server side app more secure. The spec does not require it. Is this true? What am I missing?

---

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [April 13, 2021, 7:29pm UTC](https://community.auth0.com/t/auth-code-pkce-secret-vs-no-secret/61040/3 "2021-04-13T19:29:21Z")

</div>

Hi @VictorioBerra,

Welcome to the Community!

The client secret won’t be used in the Auth Code + PKCE flow. This flow is intended for use when a backend is not available (SPA or native apps). In traditional web apps that have a backend, the original Authorization Code flow is used. Let me know if that answers your question! Here is additional info about the Auth Code + PKCE flow and an overview of the implementation with Auth0:

> **[Authorization Code Flow with Proof Key for Code Exchange (PKCE)](https://auth0.com/docs/get-started/authentication-and-authorization-flow/authorization-code-flow-with-proof-key-for-code-exchange-pkce)**
>
> Learn how the Authorization Code flow with Proof Key for Code Exchange (PKCE) works and why you should use it for native and mobile apps.

---

<div class="post-metadata">

**Author:** ![VictorioBerra](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/victorioberra/32/28773_2.png) [@VictorioBerra](https://community.auth0.com/u/VictorioBerra)\
**Post date:** [April 13, 2021, 8:05pm UTC](https://community.auth0.com/t/auth-code-pkce-secret-vs-no-secret/61040/4 "2021-04-13T20:05:56Z")

</div>

Thank you for the quick reply. The spec states that server-side clients can use PKCE, and that they can do both that and PKCE at the same time. See IS4: [IdentityServer4/Startup.cs at main · IdentityServer/IdentityServer4 · GitHub](https://github.com/IdentityServer/IdentityServer4/blob/main/samples/Clients/src/MvcCode/Startup.cs#L44-L49)

Is this not possible with Auth0? Why is that? PKCE is simpler than Hybrid flow.

---

<div class="post-metadata">

**Author:** ![VictorioBerra](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/victorioberra/32/28773_2.png) [@VictorioBerra](https://community.auth0.com/u/VictorioBerra)\
**Post date:** [April 13, 2021, 8:07pm UTC](https://community.auth0.com/t/auth-code-pkce-secret-vs-no-secret/61040/5 "2021-04-13T20:07:41Z")

</div>

I meant to say Clients with servers can do PKCE + Secrets without issue.\* I can not figure out how to edit my previous post.

---

<div class="post-metadata">

**Author:** ![stephanie.chamblee](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stephanie.chamblee/32/26087_2.png) [@stephanie.chamblee](https://community.auth0.com/u/stephanie.chamblee)\
**Post date:** [April 14, 2021, 11:18am UTC](https://community.auth0.com/t/auth-code-pkce-secret-vs-no-secret/61040/6 "2021-04-14T11:18:45Z")

</div>

Currently, the PKCE flow is only supported with public clients (native/SPA) within Auth0. If this is something that you’d like to see supported, I’d recommend providing your use case in a feature request in the Feedback category: [Feedback - Auth0 Community](https://community.auth0.com/c/feedback/95)

Thank you!

---

<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:** [April 29, 2021, 11:19am UTC](https://community.auth0.com/t/auth-code-pkce-secret-vs-no-secret/61040/7 "2021-04-29T11:19:22Z")

</div>

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