Question

Photo of Paul Tedder

0

Google OAuth working on one subdomain, but not the other

The ability to log in to Rock using one's Google authentication is a great feature and we are excited about using it when we go live with our Rock site.  We want to use it both on our internal site (rock.fellowshipgreenville.org) and our external site (currently www2.fellowshipgreenville.org)  I have been able to successfully set up our internal site to use the authentication (with just one simple entry in Google's OAuth 2.0 client ID's section) however our external site will not work but returns a 400 error, the dreaded "redirect_URL_mismatch"

I've entered multiple pages and multiple formats in the authorized redirect URLs List.  I've also added in some authorized Javascript origins URLs although I doubt they are needed. I've included a screen shot for reference. 


I've tried everything I can possibly think of and nothing seems to work.  Couple observations...

  • DNS is the same for both domains
  • double and triple checked the page numbers
  • tried http and https

The fact that it works perfectly with one domain and not the other is what is completely baffling.  It actually did work for a brief period of time when I initiallly set it up however it broke at some point after that (not sure when.)

Thanks for any feedback you can give.

  • Photo of Luke Johnston

    0

    Did you ever figure this out?  We are having trouble with our internal Google OAuth

  • Photo of Paul Tedder

    0

    Yes.  I'll include an image below that will show you what we are using... Here are some key points I've realized...

    • Full URL
    • Include the port number in the URL - since we are all https, that means :443
    • Capitalization is key... I did not capitalize "Login" and that made a difference. Once I corrected that to match the route exactly it began working.
    • Dealing with routes... I haven't quite figured this out, but sometimes it likes the page # and sometimes the route.  I've included both for the most part just to be safe.
    • Timing  -- Google is not instantaneous in its updating.  I found that I needed to wait a couple minutes, for my "change" to actually hit their servers.  I think this was my biggest issue and the cause of several headaches.
    • One tip -- don't forget to include pages that you may route to when coming back from external sites (if you're doing that)


    Oauth.png