简体   繁体   English

vb.net 中的 Gmail Oauth 2.0

[英]Gmail Oauth 2.0 in vb.net

I'm trying to find C#/VB.net examples to learn how to run oauth2 with gmail.我正在尝试查找 C#/VB.net 示例以了解如何使用 gmail 运行 oauth2。 Looking to recode an existing application that used to used gmails app password to send automated emails (logging in with just user name and password).希望重新编码一个现有的应用程序,该应用程序曾经使用 gmails 应用程序密码来发送自动电子邮件(仅使用用户名和密码登录)。 Google turned that feature off and now requires oauth 2.0. Google 关闭了该功能,现在需要 oauth 2.0。 The windows desktop application uses just a single gmail account and no other APIs from google so it should be a simple http request and response for the credentials (i think). Windows 桌面应用程序仅使用一个 gmail 帐户,没有来自 google 的其他 API,因此它应该是一个简单的 http 请求和凭据响应(我认为)。 not sure how to manage this oauth process though as it's set up for much more complicated interactions.不确定如何管理这个 oauth 过程,因为它是为更复杂的交互而设置的。 The application is using IMapX dll to manage the email interactions which isn't a paid utility and seems to have limited support anymore.该应用程序正在使用 IMapX dll 来管理电子邮件交互,这不是付费实用程序,并且似乎不再提供有限的支持。

Found this in c# which I wasn't able to convert: enter link description here How do you use Basic Authentication with System.Net.Http.HttpClient?在我无法转换的 c# 中找到了这个:在此处输入链接描述如何使用 System.Net.Http.HttpClient 的基本身份验证?

Going over google docs hasn't helped much and their example code is in python, etc. which wasn't helpful.浏览谷歌文档并没有太大帮助,他们的示例代码在 python 等中,这没有帮助。

First off go to your google account and create an apps password首先转到您的谷歌帐户并创建一个应用程序密码

replace the actual password to the account with the apps password.用应用程序密码替换帐户的实际密码。 See if that works.看看这是否有效。

It it doesnt then begin consider switching to xoauth2.然后它不会开始考虑切换到 xoauth2。 I am currently working on a sample for that in C# hang in there.我目前正在为 C# 中的示例制作一个示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM