registration question sendSetPassword flow
-
Hello, at this time I'm trying to integrate my actual app with fusion auth to develop as new feature, I want to use an invitation feature that I have developed before and migrate it here. Then, on registration API I'm sending this JSON:
{ "registration": { "applicationId": <app_id>, "data": { "displayName": "Johnny", "favoriteSports": [ "Football", "Basketball" ], }, "id": user_uuid, "preferredLanguages": [ "en", "fr" ], "timezone": "America/Chicago", "username": "johnny", "usernameStatus": "ACTIVE" }, "sendSetPasswordEmail": true, "skipVerification": false, "user": { "birthDate": "1976-05-30", "data": { "displayName": "Johnny Boy", "favoriteColors": [ "Red", "Blue" ] }, "email": "<email>", "firstName": "John", "fullName": "John Doe", "id": user_uuid, "imageUrl": "http://65.media.tumblr.com/tumblr_l7dbl0MHbU1qz50x3o1_500.png", "lastName": "Doe", "middleName": "William", "mobilePhone": "303-555-1234", "preferredLanguages": [ "en", "fr" ], "timezone": "America/Denver", "usernameStatus": "ACTIVE", "username": "johnny12333333334" } }
The problem is when I receive the setup password email, I can't set it up because I get
missing_redirect_uri
error on load page, then as a beginner and professional debugger, I set it on the setup password template (redirect_uri to my redirect_url) and get another error aboutmissing_response_code
but I don´t know how to continue, maybe I did a wrong configuration? could you help me? pleaseThank you
Version: docker 1.28.0
-
Can you offer a little bit of context around what you are aiming to accomplish?
Are you using OAuth? To log in or register your users or something else?
Finally, I am not sure if you are looking for this functionality which was release recently?
Thanks,
Josh -
Hi! I just want email link works when I send the set password for control access on register, but when I open the email and click the link I get error on FusionAuth that I shared on my first post
I don’t know why, maybe I configured something bad or I didn’t. I just up with docker as tutorial said, configured smtp credentials and use python client. User was created and receive the emailDo you know what happens? Do you need more info?
Thank you
-
Add more info:
I want to create users from my backend with "Create a User and Registration (combined)" and set "sendSetPasswordEmail" to True for user write his own password. I think something like next:
My backend --> registration on FusionAuth
FusionAuth --> email to user to configure password
User --> read email --> click link --> go to FusionAuth request his password --> redirect to app
I tested now with version 1.28.1 that if I set on "setup password" redirect_uri param it redirects to login.
User now gets this URL http://localhost:9011/password/change/<code>?client_id=<client_id>&<tenan_id>&redirect_uri=http://localhost:8000/dashboard
But instead of request him password fusionauth ask him login data, and user hasn't password.
Is this idea is wrong? i miss understand anything from the documentation?
Thank you
-
Hi again, this is me. Maybe i write this for no one, but also I want to document for other beginners or Core developers
I found a possible solution to the problem. If remove
client_id
from URL FusionAuth allows me to change the password, I think this is wrong, in the documentation didn't say anything about that, possible bug?Example good URL --> http://localhost:9011/password/change/<code>?<tenan_id>
Example bad URL --> http://localhost:9011/password/change/<code>?client_id=<client_id>&<tenan_id>Bad URL is how FusionAuth send to the new users when I set "sendSetPasswordEmail" to true with "setup password" template
Steps to reproduce:
- Create an app
- Configure smtp and setup password email
- Create API key with
user/registration
POST permission - Create a new user with sendSetPassword to true. Example payload:
{ "registration": { "applicationId": <application-id>, "data": { "displayName": "Johnny", "favoriteSports": [ "Football", "Basketball" ], }, "id": user_uuid, "preferredLanguages": [ "en", "fr" ], "timezone": "America/Chicago", "username": "johnny123", "usernameStatus": "ACTIVE" }, "sendSetPasswordEmail": true, "skipVerification": false, "user": { "birthDate": "1976-05-30", "data": { "displayName": "Johnny Boy", "favoriteColors": [ "Red", "Blue" ] }, "email": "<email>", "firstName": "John", "fullName": "John Doe", "id": <user_uuid>, "imageUrl": "http://65.media.tumblr.com/tumblr_l7dbl0MHbU1qz50x3o1_500.png", "lastName": "Doe", "middleName": "William", "mobilePhone": "303-555-1234", "preferredLanguages": [ "en", "fr" ], "timezone": "America/Denver", "usernameStatus": "ACTIVE", "username": "johnny123" } }
- Go to setup email on the email receiver
- Open URL in private tab (Just in case if you are logged)
- Get the error
missin_redirect_uri
I hope this information is useful for someone ^^
-
Hi @bergraan,
We can try filing a bug report if you feel something is not working as intended.
One thing that we can try is to do a process of elimination. To simply test this endpoint, you will want to do three things:
1. Confirm you get the SMTP test email
You should get an email like this
2. Hit the registration endpoint with a rest client like insomnia or postman
Here is the command that I ran from postman:
Our Endpoint Doc
https://fusionauth.io/docs/v1/tech/apis/registrations/#request-body-2If you run this command, you should get quite a bit back, including a token, regarding your new user. Abbreviated below.
{ "registration": { "applicationId": "85a03867-dccf-4882-adde-1a79aeec50df", }, "token": "user": { }
I was able to get a set password email.
3. Next Steps
If the above
run in postman
works for you after putting in the proper headers and UUID's for your application, then we will have to see where else items are failing.I hope this helps
Thanks,
Josh -
One more note:
You will want to ensure you are using the
client_id
on the URL.To that end, after discussing with the team, I think your URL's may be broken:
Example good URL --> http://localhost:9011/password/change/<code>?<tenan_id> Example bad URL --> http://localhost:9011/password/change/<code>?client_id=<client_id>&<tenan_id>
should be
Example good URL --> http://localhost:9011/password/change/<code>?tenantId=<tenant_id> Example bad URL --> http://localhost:9011/password/change/<code>?client_id=<client_id>&tenantId=<tenan_id>
I hope this helps!
Thanks,
Josh