Google Apps (for business) OpenID login for ASP.NE

2019-05-31 07:22发布

问题:

My company uses Google Apps for our e-mail/business app provider. Every employee has an account here.

I'm looking into creating an asp.net web app that would allow users to sign-in (using their Google Apps account) and then accomplish certain things (first goal: keep a current record of the employee's skillset).

Before I get started, I wanted to find out if an OpenID login system using Google Apps is any more difficult than doing it the standard way, or if I need to be aware of any pitfalls.

We have one domain, and the only requirement would be that the user has an open account that exists.

Thanks in advance for your thoughts on this!

回答1:

I have slides for you from a talk I gave a month ago: Google Apps Account As OpenID

http://www.slideshare.net/timdream/google-apps-account-as-openid

Basically there are two ways of doing this.

  1. Follow the Google documentation, patch your ASP.net OpenID library to accept Google Apps OpenID that is not really discoverable from the claimed URL.
  2. Install a set of discovery information on the claimed URL (/openid?id=XXXX on your website) to make your Google Apps OpenID behaviors the same way present OpenIDs do.

Either way, after completion user will be able to login to your ASP.net app with following URL:

https://www.google.com/accounts/o8/site-xrds?hd=[yourappsdomain]



回答2:

My solution to this issue was to use the DotNetOpenAuth library -- I was unaware that the latest version has Google Apps support.

Highly recommend the product -- you can find it here.

I modified one of the example files and was up and running in no time.

Thanks to all who answered!