How limit Google Federated Login to specific Apps domain?

牧云@^-^@ 提交于 2019-12-01 02:48:38

问题


I want to implement Single Sign-on in a customer's application. The customer has hosted email through Google Apps. As Google offers OpenID, this could be relatively easy to implement. However, the user might not be signed in to the correct Google Account (or even multiple accounts).

So, when using the Google OpenID endpoint https://www.google.com/accounts/o8/id the user is presented with a choice with which Google Account he/she wants to sign-in. As the application will only allow sign-ins from the Google Apps domain, this step could be skipped and should be for increased user experience. I could, however, not find ways to do this. There is this question on SO, but the links are all dead or refer to outdated specs. Also I could not find a hint in the Federated Login for Google Account Users specs.

Some places say one should use https://www.google.com/a/[domain]/o8/ud?be=o8, but that does not seem to work (anymore):

$ wget --header='Accept: application/xrds+xml' https://www.google.com/a/[domain]/o8/ud?be=o8
2012-01-24 09:29:53 ERROR 400: Bad Request.

回答1:


Although I couldn't find official records, the end point for a specific Google Apps Domain is this:

https://google.com/accounts/o8/site-xrds?hd=<domain>

When using this approach, be aware that you will run into a google-specific modification:

Google changed the way of IdP Discovery and user XRDS check a little bit to give Google Apps users openid in http://example.com/openid?id=108441225163454056756 kind of format without asking the users to build their own openid servers. For small companies, people can get their openid under their domain with as few as just a domain name if they use Google Apps. source



来源:https://stackoverflow.com/questions/8983934/how-limit-google-federated-login-to-specific-apps-domain

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!