# How to pass an ID into a signup flow securely?

**URL:** <https://community.auth0.com/t/how-to-pass-an-id-into-a-signup-flow-securely/61104>\
**Category:** Get Help\
**Created:** [April 14, 2021, 4:31pm UTC](https://community.auth0.com/t/how-to-pass-an-id-into-a-signup-flow-securely/61104 "2021-04-14T16:31:51Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![leandro.iriarte](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/leandro.iriarte/32/13136_2.png) [@leandro.iriarte](https://community.auth0.com/u/leandro.iriarte)\
**Post date:** [April 14, 2021, 4:31pm UTC](https://community.auth0.com/t/how-to-pass-an-id-into-a-signup-flow-securely/61104/1 "2021-04-14T16:31:51Z")

</div>

We have a rule that currently sets a custom claim as an id, and the value is generated within the rule.

We would like to actually pass this value into the signup flow securely. We understand that we can send the value via POST for _/oauth/token_ (for email/password flows) and via GET to _/authorize_ endpoint (for social/Authorization Code flow).

Is there any way to do this securely?

We were thinking about some verifier or key as used by the [Authorization Code Flow with Proof Key for Code Exchange](https://auth0.com/docs/flows/authorization-code-flow-with-proof-key-for-code-exchange-pkce) (PKCE).

Any recommendations/advice are welcome.

---

<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:** [April 15, 2021, 10:34pm UTC](https://community.auth0.com/t/how-to-pass-an-id-into-a-signup-flow-securely/61104/3 "2021-04-15T22:34:24Z")

</div>

Can you tell us more about the nature of the ID and the use-case? Why is passing to a rule not sufficient?

---

<div class="post-metadata">

**Author:** ![leandro.iriarte](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/leandro.iriarte/32/13136_2.png) [@leandro.iriarte](https://community.auth0.com/u/leandro.iriarte)\
**Post date:** [April 16, 2021, 8:02am UTC](https://community.auth0.com/t/how-to-pass-an-id-into-a-signup-flow-securely/61104/4 "2021-04-16T08:02:24Z")

</div>

So anonymous users get an ID. When those users signup, we would like to use the same ID, instead of creating a new one in a rule as we are doing now.

The issue is that /authorize is a public endpoint and we don’t want attackers signing up with other IDs.

We thought about creating a short-lived single-use token with the ID as a claim and send it to /authorize.

---

<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:** [April 16, 2021, 3:58pm UTC](https://community.auth0.com/t/how-to-pass-an-id-into-a-signup-flow-securely/61104/5 "2021-04-16T15:58:01Z")

</div>

I have a couple of follow up questions.

Is the /authorize request coming from a public client like a SPA?

When the ID is originally assigned to the anonymous user, are you storing it in your DB as well?

---

<div class="post-metadata">

**Author:** ![leandro.iriarte](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/leandro.iriarte/32/13136_2.png) [@leandro.iriarte](https://community.auth0.com/u/leandro.iriarte)\
**Post date:** [April 16, 2021, 4:07pm UTC](https://community.auth0.com/t/how-to-pass-an-id-into-a-signup-flow-securely/61104/6 "2021-04-16T16:07:19Z")

</div>

Yes, it comes from mobile apps.

No, it is not stored so we cannot check the same store for validity.

---

<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:** [April 16, 2021, 5:23pm UTC](https://community.auth0.com/t/how-to-pass-an-id-into-a-signup-flow-securely/61104/7 "2021-04-16T17:23:29Z")

</div>

Hm, I don’t know of an Auth0 feature that solves for this.

Are you just generating an UUID? Is collision the only thing you are concerned about?

---

<div class="post-metadata">

**Author:** ![leandro.iriarte](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/leandro.iriarte/32/13136_2.png) [@leandro.iriarte](https://community.auth0.com/u/leandro.iriarte)\
**Post date:** [April 19, 2021, 9:01am UTC](https://community.auth0.com/t/how-to-pass-an-id-into-a-signup-flow-securely/61104/10 "2021-04-19T09:01:56Z")

</div>

Yes, we are generating a UUID.

Collisions are not the issue. The goal is to keep the same id when an anonymous user signs up. But we don’t want malicious users trying to sign up with random or other people anonymous ID. That’s why the idea of the single-use short-lived jwt just to pass the utid to the sign-up 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:** [April 19, 2021, 5:48pm UTC](https://community.auth0.com/t/how-to-pass-an-id-into-a-signup-flow-securely/61104/11 "2021-04-19T17:48:41Z")

</div>

I think the issue here lies in the fact that you are trying to validate something that was created in an untrusted public client. Without issuing the UTID(or JWT) from a trusted client like a backend API, I don’t think you will find a simple way to be sure it is genuine.

---

<div class="post-metadata">

**Author:** ![leandro.iriarte](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/leandro.iriarte/32/13136_2.png) [@leandro.iriarte](https://community.auth0.com/u/leandro.iriarte)\
**Post date:** [April 22, 2021, 2:44pm UTC](https://community.auth0.com/t/how-to-pass-an-id-into-a-signup-flow-securely/61104/12 "2021-04-22T14:44:24Z")

</div>

Ok thanks.

Just one more queston:  
For social (Authorization Code) flows the rules run on the authorize endpoint, and for Resource Owner Password Grant flows (and OTP) on the oauth/token endpoint. Is this correct?

---

<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:** [April 22, 2021, 3:41pm UTC](https://community.auth0.com/t/how-to-pass-an-id-into-a-signup-flow-securely/61104/13 "2021-04-22T15:41:01Z")

</div>

Do you mean [these Rules](https://auth0.com/docs/rules)?

They run after successful authentication, which would be after a user submits credentials and they are authenticated, not specifically on a call to any endpoint.

Does that make sense? I find this graphic really helpful in visualizing where each piece of the puzzle sits.

 ![](https://global.discourse-cdn.com/auth0/original/3X/1/8/18900a53eaeaa567074d6d793543a2e5616d7682.jpeg)

---

<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 1, 2021, 5:06pm UTC](https://community.auth0.com/t/how-to-pass-an-id-into-a-signup-flow-securely/61104/14 "2021-06-01T17:06:14Z")

</div>

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