Skip to content

Invalid scopes (using the example code from README) #889

@fschlz

Description

@fschlz

Describe the bug

I'm trying to follow the examples in the README, but my scope definitions seem to be wrong, I'm just getting this error:

Microsoft Entra ID error '(invalid_scope) AADSTS1002012: The provided value for scope User.Read is not valid.

Expected behavior

code in the README should execute successfully

How to reproduce

credentials = ClientSecretCredential(
    os.getenv("AZURE_TENANT_ID"),
    os.getenv("AZURE_CLIENT_ID"),
    os.getenv("AZURE_CLIENT_SECRET"),
)

scopes = ["User.Read"]
client = GraphServiceClient(credentials=credentials, scopes=scopes)

await client.users.by_user_id('userPrincipalName').get()

SDK Version

1.5.3

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output

Click to expand log ```
</details>


### Configuration

_No response_

### Other information

_No response_

Metadata

Metadata

Assignees

No one assigned

    Labels

    WIPtype:bugA broken experiencetype:documentationGeneral documentation request or project documentation update

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions