C#服务器端oAuth

问题描述:

Bing Ads Api是否支持oAuth资源所有者密码凭证授权或不需要客户端挑战的类似机制?从我所看到的情况来看,v8拥有基于身份验证的凭据本来是完美的,但是在第9版中已经删除了


$
我们处于一个场景中需要简化身份验证过程而不向最终用户提示。

Is there a way the Bing Ads Api supports oAuth Resource Owner Password Credentials Grant or a similar mechanism that doesn't require a client-side challenge? From what I could see v8 had credentials based auth that would have been perfect, but that was removed in v9.

We're in a scenario we the auth process needs to be streamlined without a prompt to the end-user.

任何帮助表示感谢。

您好。

需要通过网络浏览器获得初步用户同意。然后安全地存储刷新令牌并重复使用它,而无需在控制台应用程序中输入用户。例如,在获得刷新令牌后,您的应用程序可以按如下方式启动:

Initial user consent via the web browser is required. Then securely store the refresh token and use it repetitively without user input in your console application. For example after you have your refresh token your application could start as follows:

var webauth = new OAuthWebAuthCodeGrant(ClientIdGoesHere, ClientSecretGoesHere, RedirectionUriGoesHere);
OAuthTokens tokens = await auth.RequestAccessAndRefreshTokensAsync(RefreshTokenGoesHere);



您可以将OAuthDesktopMobileAuthCodeGrant仅与clientId一起使用,而不是OAuthWebAuthCodeGrant。我回答了类似的问题

here
(尽管用Java编写)。


Instead of OAuthWebAuthCodeGrant you could use OAuthDesktopMobileAuthCodeGrant with only the clientId. I replied to a similar question here (though its in Java).

请与任何后续问题联系。我希望这有帮助!

Please reach out with any follow up questions. I hope this helps!