Adding date of birth field in Signup form and getting date of birth information from Social Providers


I am using AuthO for authentication in my app. I use both database connection and social connections (Facebook and Google) for authentication.

I am trying to create a custom signup form with additional fields based on this [link] (For database connection)
I am successfully able to add custom fields of type “text”. I wanted to ask is there a way I can add a field of type date in the signup form ( I want to capture user’s date-of-birth and ensure date entered is correct).

Also, I would like to know if I can get date-of-birth information from Social Providers like Facebook, Google after authentication. What scope value should I be using (currently I am using scope: ‘openid email profile’)


Currently, additionalSignUpFields in Lock do not support a date type. In saying that, as outlined in the documentation you can specify a validator function which could perform the necessary validation.

For social connections, the scopes differ between providers. For example, for Facebook, you would need to enable the Birthday scope in the connection settings (Dashboard > Connections > Social > Facebook). You would need to enable the relevant scope for all the connections you wish to use.

Thanks @prashantT for your help. I was able to add the DOB field to my form and also add validator for that.

As per your steps, I have chosen the required DOB and email field from Social Connection (Facebook). However, I am seeing a problem. The idTokenPayload object doesn’t contain both these fields.
I understand it needs App review to be able to get DOB field however email field doesn’t need any review. If that’s the case, why am I not getting user’s email in the idTokenPayload post authentication. Interestingly I do get email_verified field in the idTokenPayload .

I tried reading documentation on facebook end as well.Can’t figure what is the issue.
Can you please help me with this. Please find attached my permission selection for Facebook connection.


Hey there!

Sorry for such huge delay in response! We’re doing our best in providing you with best developer support experience out there, but sometimes our bandwidth is not enough comparing to the number of incoming questions.

Wanted to reach out to know if you still require further assistance?