用于 ASP.net 网站身份验证的 Gmail 凭据
我有两个用户名和密码文本框,现在我希望用户输入他们的公司电子邮件 ID 和密码(用户名和密码由 google 提供支持,网络服务器是 google)并登录到 ASP.net 网站。创建用户名和密码会话。此外,我希望用户能够使用相同的 gmail 凭据从 asp.net 网站发送电子邮件。提前感谢您,任何类型的帮助将不胜感激。
I have two textboxes for username and password now i want users to enter their company email Id and password (Username and password is powered by google ,webserver is google) and log in to the ASP.net website.Create session of username and password .Futher i want the user to able to send the email from asp.net website using same gmail credential.Thank you in advance and any type of help will be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您应该检查 C# 的 OpenId 库。
http://code.google.com/p/dotnetopenid/
这将为您提供良好的体验开始。这样,用户就不必直接使用其密码,并将被重定向到为您的网站授予身份验证的提供商。
You should check the OpenId library for C#.
http://code.google.com/p/dotnetopenid/
This will give you a good start. This way, the user won't have to use his password directly and will be redirect to the provider that will grant authentification for your site.
我想要的答案是这个,这个代码工作正常。而且我没有在会话和数据库中的任何地方存储密码。
但我仍然进一步怀疑如何获取用户登录以创建会话的用户名...???可以完成我在某处看到过它...
Answer which i wanted is this and this code works fine.and I am not storing password anywhere in the session and database.
but i still have further doubt is how to get the username by which the user is logged to create session ...???It can be done i have seen it somewhere...
不,谷歌不会让你这样做。您必须执行类似于 StackOverflow 正在执行的操作(提供 OpenID 功能来在 google.com 上进行身份验证)。
Nah, Google won't let you do that. You'll have to do something similar to what StackOverflow is doing (provide OpenID functionality to authenticate at google.com).