Skip to content

Assertion failed signature validation when trying to acquire a token to issue REST calls to dev ops on behalf of a user #468

@flixman

Description

@flixman

Describe the bug
I have an azure app, having granted the 'impersonate_user' permission, that needs to be able to perform calls to azure devops on behalf of the user. Instead of getting a token allowing me to do so, I get an error. Am I missing a permission on the app, am I doing something wrong, or this is a bug?

To Reproduce
Just use the following snippet with the correspondent access token, client_id, client_secret and tenant parameters.

import msal
confidential_client = msal.ConfidentialClientApplication(
            <client_id>,
            authority="https://login.microsoftonline.com/<tenant>",
            client_credential=<cliend_secret>)
devops_token = confidential_client.acquire_token_on_behalf_of(
            user_assertion=request.headers.get("X-Ms-Token-Aad-Access-Token"),
            scopes=["499b84ac-1321-427f-aa17-267ca6975798/user_impersonation"])

Expected behavior
A token in that I can use to authenticate to azure devops.

What you see instead
The error invalid_grant and the description"ADSTS50013: Assertion failed signature validation. [Reason - The provided signature value did not match the expected signature value., Thumbprint of key used by client: '8D2D57A353960E3FF9DAF6F018D82F40ED95CCC7', Found key 'Start=01/30/2022 23:06:14, End=01/30/2027 23:06:14']."

The MSAL Python version you are using
1.17.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions