Diference between Login and register Identity provider Google
-
Hi,
I have a question, is there any way to differentiate when a user is not registered and a registered user in the response of the endpoint /api/identity-provider/login ?The documentation https://fusionauth.io/docs/v1/tech/apis/identity-providers/google/#complete-the-google-login , says that it should return code 202, when not logged in, but it always returns 200. Am I doing something wrong?
Thank you
Max -
Based on the documentation, it does seem that a differentiation can be drawn out, but manually only (see bold below).
Complete the google login API - Doc
(https://fusionauth.io/docs/v1/tech/apis/identity-providers/google/#complete-the-google-login )
- The user does not need to exist yet in FusionAuth to utilize this API.
- The token returned from Google will be used to retrieve the user’s email address, if that user does not yet exist in FusionAuth the user will be created.
- If create registration has been enabled for this identity provider and the user does not yet have a registration for this application, a registration will be automatically created for the user.
- The user will be assigned any default roles configured for the application.
- If create registration has not been enabled, a registration will not be created if one does not yet exist. This last scenario is useful if you wish to manually provision users and then subsequently allow them to login with Google.
So it would seem, without testing this myself, if you disabled
create self service registration
in your application, and got the 202 code, that might be your cue to hit a registration endpoint to register that user?Another option may be to enlist the help of a webhook and/or event to watch the registrations and take action based on that.
Let me know if I am understanding correctly or if there is any other clarifying information.
Thanks!
Josh