# PKCE Flow risk of exposing publicly authDomain and clientId

**URL:** <https://community.auth0.com/t/pkce-flow-risk-of-exposing-publicly-authdomain-and-clientid/108278>\
**Category:** Get Help\
**Tags:** login-experience, new-universal-login-experience\
**Created:** [June 1, 2023, 6:49am UTC](https://community.auth0.com/t/pkce-flow-risk-of-exposing-publicly-authdomain-and-clientid/108278 "2023-06-01T06:49:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![olblak](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/olblak/32/47683_2.png) [@olblak](https://community.auth0.com/u/olblak)\
**Post date:** [June 1, 2023, 6:49am UTC](https://community.auth0.com/t/pkce-flow-risk-of-exposing-publicly-authdomain-and-clientid/108278/1 "2023-06-01T06:49:00Z")

</div>

Hi,

I am currently experimenting building a cli which would authenticate on an API using the PKCE flow.  
At the moment I have something like

```auto
mycli login --oauth-authDomain "example.auth0.com" --oauth-clientId "xxx" "example.com"

```

and I am considering exposing publicly the authDomain and the clientID via the API so I could simplify to something like

```auto
mycli login "example.com"

```

So my question, is there any security risk to expose publicly the auth domain and the clientid?  
They are the same for anyone using the application anyway  
Is there a better way to authenticate on an API than using the PKCE flow?

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [June 13, 2023, 12:38pm UTC](https://community.auth0.com/t/pkce-flow-risk-of-exposing-publicly-authdomain-and-clientid/108278/3 "2023-06-13T12:38:18Z")

</div>

Hi @olblak,

Welcome to the Auth0 Community!

The domain and client ID are designed to be shared with the client and have exposed to the end user in the PKCE flow.

Hope that helps!

---

<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:** [June 29, 2023, 2:52pm UTC](https://community.auth0.com/t/pkce-flow-risk-of-exposing-publicly-authdomain-and-clientid/108278/4 "2023-06-29T14:52:11Z")

</div>

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