Skip to content

The acquire_token_silent method sometimes does not return the idtoken and id_token_claims #139

Open
@arthur00

Description

@arthur00

I have an application where I can cache (using SerializableTokenCache) the user's tokens. When I load the token cache back in, I do acquire_token_silent to refresh the access token.

The issue is I've seen two different behaviors from this line:
newtoken = self.app.acquire_token_silent(["https://database.windows.net//.default"],
account=self.account)

  1. I get idtoken and id_token_claims from the acquire_token_silent method (Good)
  2. I get only access_token, token_type, and expires_in, as in the image below: (Bad)

image

This second case makes my life harder because I need a way to access the IdToken (and to decode it so I can get the user given name). I could technically dig on the token_cache object to get the IdToken then find the decoding function deep inside the msal library to get the user given name, but I'm guessing this is not intended behavior.

I'm not sure why I get these two different behaviors yet - must be something to do with refreshing the tokens, but I can't reproduce case 1 at will (I'm not getting any id_tokens now).

Let me know if I'm missing something here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Commited

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions