none
No option for 'bingads.manage' permission RRS feed

  • Question

  • Hi everyone,

    I'm trying to get started using the bing ads api with a web application I'm developing, and I've been able to successfully log in to my app via a microsoft account using oauth2. However, when, as specified by the bing ads api documentation, I add 'bingads.manage' to the list of scopes I am requesting, I get this error:

    The provided value for the input parameter 'scope' is not valid. The scope bingads.manage is not valid

    I've noticed I get a similar error if I request any scope that I haven't added to my app's delegated permissions via the dashboard at https://apps.dev.microsoft.com. The obvious thing to try is to add bingads.manage to the delegate permssions list, but when I click 'add' it doesn't appear under the list of possible permissions.

    I am unsure how to proceed, and would appreciate suggestions. Let me know if there is any additional information that would be useful.

    Saturday, November 4, 2017 12:26 AM

All replies

  • You shouldn't have to add bingads.manage anywhere in the registration portal. You should add it to the HTTP string as documented in this guide. If you've done this and have a trace of the request / response I'm happy to take a closer look. 

    I hope this helps,

    Eric

    Tuesday, November 7, 2017 3:34 AM
    Owner
  • Hey Eric,

    I've added it to the scope in the URL as well; the portal was a guess, as I've gotten the same error for other scopes, and adding there had fixed the issue. With the credentials censored, this is printed out by my local development server:

    127.0.0.1 - - [10/Nov/2017 19:15:39] "GET / HTTP/1.1" 200 -
    INFO:werkzeug:127.0.0.1 - - [10/Nov/2017 19:15:39] "GET / HTTP/1.1" 200 -
    DEBUG:flask_dance.consumer.oauth2:client_id = REDACTED_CLIENT_ID
    DEBUG:requests_oauthlib.oauth2_session:Generated new state REDACTED_STATE.
    DEBUG:flask_dance.consumer.oauth2:state = REDACTED_STATE
    DEBUG:flask_dance.consumer.oauth2:redirect URL = https://login.microsoftonline.com/common/oauth2/v2.0/authorize?response_type=code&client_id=REDACTED_CLIENT_ID&redirect_uri=http%3A%2F%2Flocalhost%3A8000%2Flogin%2Fazure%2Fauthorized&scope=bingads.manage&state=REDACTED_STATE
    127.0.0.1 - - [10/Nov/2017 19:15:42] "GET /login/azure HTTP/1.1" 302 -
    INFO:werkzeug:127.0.0.1 - - [10/Nov/2017 19:15:42] "GET /login/azure HTTP/1.1" 302

    The URL my browser ends up at matches the redirect URL in that output:

    https://login.microsoftonline.com/common/oauth2/v2.0/authorize?response_type=code&client_id=REDACTED_CLIENT_ID&redirect_uri=http%3A%2F

    The page itself displays the error:

    Additional technical information:
    Correlation ID: 5f78b718-888a-43e8-862c-c8d3726528e7
    Timestamp: 2017-11-11 00:15:18Z

    AADSTS70011: The provided value for the input parameter 'scope' is not valid. The scope bingads.manage is not valid.

    I'm not sure what to make of it.

    Saturday, November 11, 2017 12:26 AM
  • From the authentication guide:

    "If you register a native app you should ignore the provided redirect URI and instead use https://login.live.com/oauth20_desktop.srf as the redirect URI."

    I hope this helps!

    Monday, November 13, 2017 4:54 PM
    Owner
  • I'm developing a web app, not a native app. localhost is there because I'm doing development on my laptop, but it is actually a web app, so the redirect url is rather important. Thanks for the suggestion.
    Monday, November 13, 2017 8:22 PM
  • Ack sorry I should have referred to this auth URL for user consent: https://login.live.com/oauth20_authorize.srf .. please try it instead of the v2 endpoint (https://login.microsoftonline.com/common/oauth2/v2.0/authorize). 
    Monday, November 13, 2017 8:35 PM
    Owner
  • That (along with fixing the token URL) did the trick, thanks for your help.

    Thursday, November 16, 2017 1:00 AM