Missing the registrationVerificationId Value in User Response
-
I bulk registered some test users into my system a while back, prior to the release of v1.27.0. We are now on v1.30.0. While my users have accounts and are registered to my application, the registration isn't verified. I now get the 213 status back instead of 200.
I'm updating my code to handle this. Per the API docs it says that:
213
The user’s registration has not yet been verified. The response will contain the User object that was authenticated. If the emailConfiguration.verificationStrategy has been set to FormField, the response will contain the registrationVerificationId that was generated for the user.I went into the Application's Registration settings and set the verification strategy to Form field:
However, when I make a call to login my user in, even though I get the 213 status, and I see verified: false in the user.registrations array (I only have a single registration), I still don't have a registrationVerificationId. Model looks like:
"registrations": [ { "applicationid": "cb372f8c-3742-7189-ab29-4ae5ed5e7ca5", "id": "effd1se2-6ccb-4c59-89a6-33a965234987", "insertinstant": 1617025021232, "lastlogininstant": 1629840206323, "lastupdateinstant": 1617025021232, "preferredlanguages": [ "en" ], "timezone": "America/Chicago", "username": "johndoe@someemail.com", "usernamestatus": "ACTIVE", "verified": false } ]
Did I do something incorrectly here? Am I missing something? Is this a bug? I searched and didn't find much info about this issue.
-
@pmolaro Minor update. I came across this info in the Create Tenant docs today ( https://fusionauth.io/docs/v1/tech/apis/tenants/ ) :
__
tenant.emailConfiguration.unverified.behavior [String] OPTIONAL Defaults to Allow AVAILABLE SINCE 1.27.0
The desired behavior during login for a user that does not have a verified email. The possible values are:
Allow - the user will be allowed to complete login.
Gated - verification is required before a user can complete login. The use of this value will require a paid edition of FusionAuth.
__While I do not see those settings in the Tenant settings in the admin UI, I went back to the Application > Registrations settings and tried to set the "Unverified behavior" setting to Gated. But when I do that I get an error that says "Reactor license required".
So is Gatting to get a verificationID back in the API a paid feature? Is that why this doesn't appear to work?
-
I think that the issue here is you need to take that
verificationId
and call another API endpoint to confirm that the email address has been verified.Specifically, you will need to call verify-email API with the
verificationId
(and other required information) to get the following toggled totrue
.user.registrations.[x].verified: true
Here is the endpoint I am referring to:
https://fusionauth.io/docs/v1/tech/apis/users/#verify-a-users-email
You might also take note of the ability to resend a
verificationId
listed in that same documentation (if you scroll down).The ability to gate a user is a paid feature but based on what you have told me so far, I don't believe this is the source of your difficulty.
Let me know if you have any questions.
Thanks,
Josh -
@joshua said in Missing the registrationVerificationId Value in User Response:
https://fusionauth.io/docs/v1/tech/apis/users/#verify-a-users-email
@Joshua Thanks for the reply. I'm aware of the follow up call that needed, however, as you can see in my response model in my post, I'm not getting back the verificationId at all. That's my core issue. Once I get that id, then I can make a follow up call to verify the user's registration. Ideally this will all happen behind the scenes and my users will not even be aware.
Any thoughts on why I'm not getting a verificationId to begin with?
-
This post is deleted! -
I think I understand now.
If you imported a few users, they should be given the option via UI to have the verification email sent to them again (if you are using the OAuth flows/hosted pages)
If you are not using the OAuth flows in Fusionauth (this seems to be true, based on what you said), then I think that you would need to offer the user the ability to now verify through this API
https://fusionauth.io/docs/v1/tech/apis/users/#resend-verification-email, which will return averificationId
Also, there is a tutorial for email verification (the gating part is a paid feature) and we are developing one (very similar) for application registrations as well (the gating part is a paid feature).
https://fusionauth.io/docs/v1/tech/tutorials/gate-accounts-until-verified/Let me know if that more gets at your question.
Thanks,
Josh