Showing Error Message to User in Google Authentication
-
Hello.
I'm putting together a workflow to Authenticate through a 3rd party like Google using Cloud Platform of FusionAuth. Since the initial response from Google is consumed by my application, I will be determining whether the user logged in successfully or not. If the code is blank in Google response for example, I'll know that the Authentication failed. How do I show the message to the user that their Authentication failed?
TIA
Rudy -
@it-contracts I'm sorry, I'm not sure I understand.
Can you spell out in steps what you'd like to see?
- User goes to example.com
- User clicks 'login with google'.
- User fails to sign in with google.
- ...
If you have two scenarios, two sets of steps would be helpful.
Thanks!
-
@dan Thank you Dan for your response. I'm new to FusionAuth. My understanding though of the process that FusionAuth offers is the following.
- I create an Application
- Then I create an Identity Provider for this Application, Google in this example
- I provide a URL from my Application to the user which if they click on they will get the Login screen with the Login with Google button.
- They click on Login with Google and go to Google to Authenticate
- My callback Servlet/Program is sitting and waiting to get the code from Google if the Authentication was successful. However, if I get a response from Google to my callback program with the code blank and an error message, then it would be up to me to notify the user that an error took place. No? So how do I show this error (or my own customized error message) to the user at this point? At this point they have left the Google realm and the hot potato is my hands.
Thank you in advance for your time.
If I'm not understanding how FusionAuth works I'm happy to hear RTFM with hopefully a specific link.Rudy
-
@it-contracts , if the login for Google fails, then it would be on the "Applicaiton" to show that failure. It could be as simple as a page that displays "User Not Logged In" when trying to access a secure page. I don't think your application should be responsible for displaying the problem with the authentication. You are handling that off to Google in this example. All your application should be concerned with is if the user is authenticated or not.
I'm not going to give the the RTFM manual response, but have you taken a look at any of our quickstarts quickstarts? This one uses Java and Spring time but there many languages. They should all be pretty quick to get through. If you are just interested in seeing it work, there should be a completed application in the
complete-application
folder of the repo.Sometimes, seeing concrete examples helps more than talking hypothetical discussion.
-
@mark-robustelli Thank you Mark.
-
@it-contracts, just wanted to check in and see how it is going? Have you been able to accomplish what you were working on?
-
@mark-robustelli Thank you Mark. You are very very nice. No unfortunately I'm still stuck on both of my questions that I asked here. No progress.
-
@it-contracts Were you able to get the quickstart going? I think once you do that, you can follow https://fusionauth.io/docs/v1/tech/identity-providers/google and that will get you the info you need.
-
@mark-robustelli Yes, that is actually where I started my integration. At this point I've been up and down the documentation. There is really no complete start to finish example. Just fragments that have the connections between them missing.