From a3b82b840d5e8e1df94ba270b901ee59115e70e7 Mon Sep 17 00:00:00 2001 From: Cliff Eversdyk Date: Tue, 19 Jan 2021 13:03:51 -0600 Subject: [PATCH] add web app auth support by instantiating with the app client_id, client_secret, and redirect uri --- bingads/authorization.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/bingads/authorization.py b/bingads/authorization.py index cbaf6b02..9161cdc4 100644 --- a/bingads/authorization.py +++ b/bingads/authorization.py @@ -576,7 +576,28 @@ class OAuthWebAuthCodeGrant(OAuthWithAuthorizationCode): For more information about registering a Bing Ads application, see http://go.microsoft.com/fwlink/?LinkID=511607. """ - pass + def __init__(self, client_id, client_secret, app_redirect_uri, oauth_tokens=None, env=PRODUCTION, require_live_connect=False, tenant='common'): + """ Initializes a new instance of the this class with the specified client id, client secret, and the app redirect URI. + + :param client_id: The client identifier corresponding to your registered application. + :type client_id: str + :param client_secret: The client secret corresponding to your registered application. + :type client_secret: str + :param app_redirect_uri: The redirect uri corresponding to your registered application. + :type app_redirect_uri: str + :param oauth_tokens: Contains information about OAuth access tokens received from the Microsoft Account authorization service + :type oauth_tokens: OAuthTokens + """ + + super(OAuthWebAuthCodeGrant, self).__init__( + client_id, + client_secret, + app_redirect_uri, + oauth_tokens=oauth_tokens, + env=env, + require_live_connect=require_live_connect, + tenant=tenant + ) class OAuthDesktopMobileImplicitGrant(OAuthAuthorization):