# Mandatory country field when signing up

**URL:** <https://community.auth0.com/t/mandatory-country-field-when-signing-up/120282>\
**Category:** Get Help\
**Tags:** user-profile, user-management\
**Created:** [November 6, 2023, 8:50am UTC](https://community.auth0.com/t/mandatory-country-field-when-signing-up/120282 "2023-11-06T08:50:42Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![DenverKrueger](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@DenverKrueger](https://community.auth0.com/u/DenverKrueger)\
**Post date:** [November 6, 2023, 8:50am UTC](https://community.auth0.com/t/mandatory-country-field-when-signing-up/120282/1 "2023-11-06T08:50:42Z")

</div>

Hi all!  
I need the country of a user. I would like to have it as a mandatory field when signing up. I use the hosted sign up page of Auth0 (loginWithRedirect). I don’t see an option to show such a field. Is there a possibility?

Thanks!

---

<div class="post-metadata">

**Author:** ![DenverKrueger](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@DenverKrueger](https://community.auth0.com/u/DenverKrueger)\
**Post date:** [November 13, 2023, 7:54am UTC](https://community.auth0.com/t/mandatory-country-field-when-signing-up/120282/3 "2023-11-13T07:54:26Z")

</div>

Hi, any information on this? I found this article: [Adding Country to a User's Profile with Auth0 Rules](https://auth0.com/blog/adding-country-to-a-users-profile-with-auth0-rules/)  
But it is a solution with rules which are now deprecated.

---

<div class="post-metadata">

**Author:** ![DenverKrueger](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@DenverKrueger](https://community.auth0.com/u/DenverKrueger)\
**Post date:** [November 22, 2023, 5:30am UTC](https://community.auth0.com/t/mandatory-country-field-when-signing-up/120282/4 "2023-11-22T05:30:25Z")

</div>

Hi, has anyone an idea how to implement this?

---

<div class="post-metadata">

**Author:** ![dawid.matuszczyk](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dawid.matuszczyk/32/74550_2.png) [@dawid.matuszczyk](https://community.auth0.com/u/dawid.matuszczyk)\
**Post date:** [November 30, 2023, 7:30pm UTC](https://community.auth0.com/t/mandatory-country-field-when-signing-up/120282/5 "2023-11-30T19:30:48Z")

</div>

Hi @DenverKrueger

Welcome to the Auth0 Community!

Sorry for the late response to your question.

In the Action [event.request.geoip](https://auth0.com/docs/customize/actions/flows-and-triggers/pre-user-registration-flow/event-object#:~:text=the%20following%20properties%3A-,geoip,-Object.) object there’s property countryName from which you can fetch it add it to the user metadata → [Pre User Registration Flow](https://auth0.com/docs/customize/actions/flows-and-triggers/pre-user-registration-flow#set-metadata-in-the-user-profile)

I hope it will help you

Thanks  
Dawid

---

<div class="post-metadata">

**Author:** ![DenverKrueger](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@DenverKrueger](https://community.auth0.com/u/DenverKrueger)\
**Post date:** [December 1, 2023, 9:18am UTC](https://community.auth0.com/t/mandatory-country-field-when-signing-up/120282/6 "2023-12-01T09:18:12Z")

</div>

Hi @dawid.matuszczyk,

thanks and no problem! Yes, I saw that, but I guess there would be a problem with users that use a VPN for example. I would create a user on my end with the wrong country. Is there another way?

Thanks for your time!

---

<div class="post-metadata">

**Author:** ![DenverKrueger](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@DenverKrueger](https://community.auth0.com/u/DenverKrueger)\
**Post date:** [December 14, 2023, 5:33am UTC](https://community.auth0.com/t/mandatory-country-field-when-signing-up/120282/7 "2023-12-14T05:33:54Z")

</div>

Hi @dawid.matuszczyk,

have you had time to look into this?

Thanks

---

<div class="post-metadata">

**Author:** ![dawid.matuszczyk](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dawid.matuszczyk/32/74550_2.png) [@dawid.matuszczyk](https://community.auth0.com/u/dawid.matuszczyk)\
**Post date:** [December 18, 2023, 4:39pm UTC](https://community.auth0.com/t/mandatory-country-field-when-signing-up/120282/8 "2023-12-18T16:39:20Z")

</div>

Hi @DenverKrueger

Sorry for the late response. If the user is actively using a VPN, you can access only the country that the user currently uses to connect to your site (via VPN). Also, if the user is using a VPN to connect to your site from another country, this wouldn’t create the wrong data entry, the data will come from the VPN connection.

Thanks  
Dawid

---

<div class="post-metadata">

**Author:** ![DenverKrueger](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@DenverKrueger](https://community.auth0.com/u/DenverKrueger)\
**Post date:** [December 29, 2023, 2:10pm UTC](https://community.auth0.com/t/mandatory-country-field-when-signing-up/120282/9 "2023-12-29T14:10:53Z")

</div>

Hi @dawid.matuszczyk,

okay, but because of this issue, I want the user to actively select his “correct” country. So during the registration, he can select his country to not get the perhaps “wrong” country from his IP.

Thanks

---

<div class="post-metadata">

**Author:** ![dawid.matuszczyk](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dawid.matuszczyk/32/74550_2.png) [@dawid.matuszczyk](https://community.auth0.com/u/dawid.matuszczyk)\
**Post date:** [December 29, 2023, 2:41pm UTC](https://community.auth0.com/t/mandatory-country-field-when-signing-up/120282/10 "2023-12-29T14:41:25Z")

</div>

Hi @DenverKrueger

So if an action is not an option, you have a few options. First, there’s no plug-and-play feature where you can add a dialog box or multi-select in nocode and add information to the user metadata.

1. **Customize New Universal Login Pages**

> You can customize the New Universal Login pages by providing a page template using the Liquid template language. To learn more about Liquid, read [the Introduction to Liquid](https://shopify.github.io/liquid/basics/introduction/)on Github. You can update the ULP templates only using the Management API. This capability can only be used if the tenant has [Custom Domains](https://auth0.com/docs/customize/custom-domains) enabled.

This way, you can extend a New Universal Login of additional fields. The page will still be hosted on Auth0, and you won’t need to take care of managing users on your side.

1. **Selfhosted Signup page**  
This way, you can add as many additional fields during signups and send them to the Auth0 via ManagmentAPI [Auth0 Management API v2](https://auth0.com/docs/api/management/v2/users/post-users)

2. **Lock of Web** → [Lock for Web](https://auth0.com/docs/libraries/lock)  
The last and probably the worst option is to go with Lock for Web with Text Fields or Select ([Lock Configuration Options](https://auth0.com/docs/libraries/lock/lock-configuration#text-fields)). In a text field option, the user will need to type the country or select from many, which will later be saved in the User metadata.

I think those are all the available options.  
Thanks  
Dawid

---

<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:** [January 12, 2024, 2:41pm UTC](https://community.auth0.com/t/mandatory-country-field-when-signing-up/120282/11 "2024-01-12T14:41:49Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dawid.matuszczyk](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dawid.matuszczyk/32/74550_2.png) [@dawid.matuszczyk](https://community.auth0.com/u/dawid.matuszczyk)\
**Post date:** [May 14, 2024, 11:53am UTC](https://community.auth0.com/t/mandatory-country-field-when-signing-up/120282/12 "2024-05-14T11:53:33Z")

</div>

Hey team!

This topic seems related to our new EA feature, Forms for Actions, which rolled out of the beta stage on May 7th. Our Product team prepared the whole Documentation page with examples of Use cases. [Forms for Actions](https://auth0.com/docs/customize/forms). If you find yourself having questions regarding this new feature for the next two weeks, we are hosting an [Ask Me Anything session](https://community.auth0.com/t/auth0-community-ask-me-anything-customize-and-extend-ciam-with-new-forms-for-actions/133516). Our Product Expert will provide comprehensive written answers on May 21st from 8 AM to 10 AM PST.  
Find out more about [Forms for Actions](https://auth0.com/docs/customize/forms) and [learn more about AMA](https://community.auth0.com/t/auth0-community-ask-me-anything-customize-and-extend-ciam-with-new-forms-for-actions/133516).

Thanks!  
Dawid
