Issue with logout redirect using Google OAuth

Tags: #<Tag:0x00007fceb3a8a5f0>

Application Name: Reference Application **Version Number:2.11.0

I am using Google OAuth2 on my OpenMRS and when I logout, it takes me to Google sign in page again. So when I login again using my Google account it should take me to OpenMRS login but it takes me to Google Account settings. I think its an issue with logout redirect.

Can someone point me to the right direction? I have read almost all articles related to OAuth on OpenMRS wiki but couldn’t find something.

Thanks again in advance for helping me out!

Hey @hardikaj,

I “think” I understood your question but I’m 100% sure. Is it about the flow below?

  1. Attempting to access an OpenMRS URL
  2. ⇒ Redirection to Google’s login.
  3. Logging into Google ⇒ redirection to OpenMRS as an authenticated user.
  4. Using OpenMRS… etc.
  5. Logging out from OpenMRS ⇒ signs you off from Google (and hence from OpenMRS).
  6. At that point you’re brought back to a Google login screen.

And this is where you’d hope that signing in again into Google would redirect the user to OpenMRS right?

1 Like

YES! This is exactly what I am talking about!

Would be really helpful if someone could help me find a solution for it!

@dkayiwa @gcliff your help would be greatly appreciated in this issue!

Hey @mksd,

Also in the 3rd step you provided, after Google’s login screen, when I login using Google account, it is redirected to OpenMRS login page where I have to login again. I am looking to solve this dual-login issue. Please let me know if you have something on this. I have already seen all posts related to this on this site and have found only this approach. Let me know if there is a simpler approach available!

Thanks again for helping me out as always. I am really grateful to have found this community!

Well there is something really wrong with your setup if you’re being asked to login again…

But maybe you simply forgot to enable the two-step login. See:

1 Like

Hey @mksd thanks again for coming to save the day! I really appreciate your help these past days!