在浏览器中提供同意的方式 [英] Way to Provide Consent Other Than in Browser

查看:85
本文介绍了在浏览器中提供同意的方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了一个Python脚本与Bing Ads API交谈以下载广告系列效果报告。当我第一次运行此脚本时,我在浏览器中提供了同意。但是现在我们想在没有浏览器的Amazon S3 lambda函数上运行这个脚本。
我的问题是,除了在浏览器中,是否有任何方式提供同意。谢谢!

解决方案

您好。


每个常见问题:


以编程方式管理Bing Ads帐户,您必须至少通过Web应用程序同意流程提供一次同意。对于
重复或长期身份验证,您应该遵循 
授权代码授权流程   for
获取访问令牌和刷新令牌。此后,您可以使用最新的刷新令牌来请求新访问权限并刷新令牌,而无需进一步的用户交互。您可能需要再次请求用户同意,例如,如果Microsoft帐户所有者
通过帐户恢复,更改了密码或以其他方式删除了应用程序的权限,以代表他们进行身份验证。


https://docs.microsoft.com/en-us/bingads/guides/faq?view=bingads-12#oauth


对于云方案,请一定要注册一个网络应用程序并使用client_id和client_secret。 


我希望这有帮助!


Eric


I wrote a Python script to talk to Bing Ads API to download campaign performance report. And I provided consent in browser when the first time I ran this script. But now we want to run this script on Amazon S3 lambda function which there is no browser. My question is if there's any ways to provide consent other than in browser. Thank you!

解决方案

Hello.

Per FAQ:

To programatically manage a Bing Ads account, you must provide consent at least once through the web application consent flow. For repeat or long term authentication, you should follow the authorization code grant flow for obtaining an access token and refresh token. Thereafter you can use the latest refresh token to request new access and refresh tokens without any further user interaction. You may need to request user consent again for example, if the Microsoft Account owner went through account recovery, changed their password, or otherwise removed permissions for your application to authenticate on their behalf.

https://docs.microsoft.com/en-us/bingads/guides/faq?view=bingads-12#oauth

For the cloud scenario please be sure to register a web app and use both client_id and client_secret. 

I hope this helps!

Eric


这篇关于在浏览器中提供同意的方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆