【发布时间】:2012-06-28 11:55:09
【问题描述】:
我正在尝试在我的应用程序中使用 open id,并且我已使用 DotNetOpenId 成功完成此操作。
现在,Google 为公司域名下的电子邮件和其他服务提供服务。 (例如 example@acompany.com)。有没有办法将身份验证范围缩小到仅限公司用户?
我知道我可以通过检查回复中的电子邮件地址来做到这一点。但我不认为这是一个好主意。如果用户未通过 acompany.com 以外的 Google 帐户进行身份验证,则更好。
请注意,我不知道 Open Authentication 或 DotNetOpenId 的内部逻辑。
编辑
默认谷歌的openId请求提示https://accounts.google.com/ServiceLogin?...
我可以手动将其(在浏览器中)更改为 https://accounts.google.com/a/iit.du.ac.bd/ServiceLogin?... 并且可以正常工作(iit.du.ac.bd 是我学校的域)
我尝试使用
创建请求 Identifier id1 = Identifier.Parse("https://www.google.com/a/iit.du.ac.bd");
Identifier id2= Identifier.Parse("https://www.google.com/a/iit.du.ac.bd/accounts/o8/id");
var openid = new OpenIdRelyingParty();
IAuthenticationRequest request1 = openid.CreateRequest(id1);
IAuthenticationRequest request2 = openid.CreateRequest(id2);
Google 的标识符是 https://www.google.com/accounts/o8/id"
编辑2
【问题讨论】:
标签: asp.net-mvc-3 openid dotnetopenauth google-openid