Azure-Samples / ms-identity-docs-code-python

Source for the Python code snippets in the Microsoft identity platform documentation found on https://docs.microsoft.com.
https://docs.microsoft.com/azure/active-directory/develop
MIT License
13 stars 22 forks source link

Error to set up the AUTH #31

Open cavalerosi opened 1 month ago

cavalerosi commented 1 month ago

Please provide us with the following information: When I'm trying to create An AUTH object using scopes I getting the error TypeError: __init__() got an unexpected keyword argument 'scopes' Also getting error when trying to access Auth' object has no attribute 'get_token_for_user'

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Any log messages given by the failure

Expected/desired behavior

OS and Version?

Windows 8, 10, or 11. Linux (which distribution). macOS (Mojave? Catalina? Big Sur? Monterey?)

Versions

Mention any other details that might be useful


Thanks! We'll be in touch soon.

surfgreendev commented 3 weeks ago

I face the same error, any updates?

nickcounts commented 2 weeks ago

Removing the scopes argument allowed me to launch the Django test server, it forwards me to the sign in page, I select my user, and then it says "Have an admin account? Sign in with that" or "Return to the application without granting consent"

Not sure if that's on the Azure app registration side or something to do with the scope configuration.

AUTH = Auth(
    os.getenv('CLIENT_ID'),
    client_credential=os.getenv('CLIENT_SECRET')
    redirect_uri=os.getenv('REDIRECT_URI'),
    # scopes=os.getenv('SCOPE', "").split(),
    authority=os.getenv('AUTHORITY'),
)