Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8730425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:01:08+00:00 2026-06-13T09:01:08+00:00

I’d like to use Google’s Oauth2 API to login to an application based on

  • 0

I’d like to use Google’s Oauth2 API to login to an application based on an e-mail address. Considering users may not know if their me@mydomain.com is hosted by google, how could I inspect their e-mail address and redirect them to Google Auth via code? For example, on a typical login page you’ve seen the “login with my google account” button, but if the users doesn’t know it’s a google account I’d still like to use OAUTH even if they didn’t click it.

I’ve considered a DNS lookup on the MX record, but not sure if that’s the cleanest/best approach.

i.e. a typical DNS lookup returns:

mydomain.com      MX preference = 10, mail exchanger = aspmx.l.google.com
mydomain.com      MX preference = 20, mail exchanger = alt1.aspmx.l.google.com
mydomain.com      MX preference = 20, mail exchanger = alt2.aspmx.l.google.com
...
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T09:01:09+00:00Added an answer on June 13, 2026 at 9:01 am

    An nslookup on MX records would probably be the most practical solution and would be rather simple.

    The issue I have with this is that unless your application exclusively requires you to use their Google e-mail, you might be excluding some people. I have an alternate e-mail address set up with my Google account and can use that to log in. Now, I would venture to guess most users would use their Google e-mail account, but you need to be ready for the other case.

    My suggestion is to first use an easier, deprecated method, like ClientLogin. You can do a simple post using https://www.google.com/accounts/ClientLogin?Email=who@where.com&Passwd=password

    If you get “Error=BadAuthentication”, then the authentication failed. If you get a good authentication, you know this e-mail address is associated with a Google account and then you can use Oauth2 to log them in. The only issue I see with this is if the user enters an incorrect password. I would do some research across all of the Google APIs to see if any of them can tell you about an incorrect password vs. just a failed login, though that might not exist for security purposes.

    Anyway, good luck. Keep us updated if you come up with something else.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I'm making a simple page using Google Maps API 3. My first. One marker
For some reason, after submitting a string like this Jack’s Spindle from a text
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
I am trying to understand how to use SyndicationItem to display feed which is
I've got a string that has curly quotes in it. I'd like to replace
I have a small JavaScript validation script that validates inputs based on Regex. I
I would like to run a str_replace or preg_replace which looks for certain words

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.