# Is it a safe way to use the loginWithRedirect to pass extra parameter?

**URL:** <https://community.auth0.com/t/is-it-a-safe-way-to-use-the-loginwithredirect-to-pass-extra-parameter/102000>\
**Category:** Get Help\
**Tags:** classic-universal-login-experience, login-experience\
**Created:** [March 7, 2023, 4:00pm UTC](https://community.auth0.com/t/is-it-a-safe-way-to-use-the-loginwithredirect-to-pass-extra-parameter/102000 "2023-03-07T16:00:35Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![wan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/wan/32/37479_2.png) [@wan](https://community.auth0.com/u/wan)\
**Post date:** [March 7, 2023, 4:00pm UTC](https://community.auth0.com/t/is-it-a-safe-way-to-use-the-loginwithredirect-to-pass-extra-parameter/102000/1 "2023-03-07T16:00:35Z")

</div>

I have been searching for a solution to send some information over to the classic universal login screen from my app. One option is to use the loginWithRedirect with an extra parameter. Want to confirm with you: is it a secure way to do it?

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [March 7, 2023, 11:42pm UTC](https://community.auth0.com/t/is-it-a-safe-way-to-use-the-loginwithredirect-to-pass-extra-parameter/102000/3 "2023-03-07T23:42:22Z")

</div>

Hey there @wan!

> [@wan](#):
>
> One option is to use the loginWithRedirect with an extra parameter. Want to confirm with you: is it a secure way to do it?

Yes, this is the correct way to pass params - If you are using v2 of `auth0-react`, `auth0-angular`, etc. then you will want to make sure and be aware of the introduction `authorizationParams` as outlined [here](https://github.com/auth0/auth0-react/blob/master/MIGRATION_GUIDE.md#introduction-of-authorizationparams).

Hope this helps!

---

<div class="post-metadata">

**Author:** ![wan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/wan/32/37479_2.png) [@wan](https://community.auth0.com/u/wan)\
**Post date:** [March 7, 2023, 11:57pm UTC](https://community.auth0.com/t/is-it-a-safe-way-to-use-the-loginwithredirect-to-pass-extra-parameter/102000/4 "2023-03-07T23:57:44Z")

</div>

Thanks @ty.frith ! Want to add more context: we want to pass a jwt token which contains user’s information(e.g. email) to Classic Universal Login via this way. Is it secure if we use loginWithRedirect?

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [March 8, 2023, 12:10am UTC](https://community.auth0.com/t/is-it-a-safe-way-to-use-the-loginwithredirect-to-pass-extra-parameter/102000/5 "2023-03-08T00:10:33Z")

</div>

No problem, happy to help where I can!

> [@wan](#):
>
> we want to pass a jwt token which contains user’s information(e.g. email) to Classic Universal Login via this way

Hmm… I’m not entirely sure what you mean by passing a jwt to UL - Is there a reason in particular you’d do this? Can you elaborate on the overall use case a bit?

---

<div class="post-metadata">

**Author:** ![wan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/wan/32/37479_2.png) [@wan](https://community.auth0.com/u/wan)\
**Post date:** [March 8, 2023, 12:32am UTC](https://community.auth0.com/t/is-it-a-safe-way-to-use-the-loginwithredirect-to-pass-extra-parameter/102000/6 "2023-03-08T00:32:17Z")

</div>

Sure!

For our case: We encode the user’ email. And the token is actually the user email. We want to pass the token to the classic universal login page, then decode it to get user email. So, want to ensure it’s the correct and secure way because “redirect” happens in the process. and we might not want to expose the token in the network.

---

<div class="post-metadata">

**Author:** ![wan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/wan/32/37479_2.png) [@wan](https://community.auth0.com/u/wan)\
**Post date:** [March 8, 2023, 11:27pm UTC](https://community.auth0.com/t/is-it-a-safe-way-to-use-the-loginwithredirect-to-pass-extra-parameter/102000/7 "2023-03-08T23:27:47Z")

</div>

Hey @ty.frith , is it a secure way for our case?

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [March 8, 2023, 11:57pm UTC](https://community.auth0.com/t/is-it-a-safe-way-to-use-the-loginwithredirect-to-pass-extra-parameter/102000/8 "2023-03-08T23:57:57Z")

</div>

Hey @wan!

It’s secure in the sense that if sent in the POST it will be over `https` - It’s still unclear to me why you’d need to include a token in the request at all. If you include the `email` scope in the request, you’ll end up with an `email` claim in tokens as well.

---

<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:** [March 22, 2023, 11:58pm UTC](https://community.auth0.com/t/is-it-a-safe-way-to-use-the-loginwithredirect-to-pass-extra-parameter/102000/9 "2023-03-22T23:58:53Z")

</div>

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