globus / globus-sdk-python

Globus SDK for Python
Apache License 2.0
68 stars 38 forks source link

Remove identity ID consistency validation from ClientApp #1111

Closed derek-globus closed 1 week ago

derek-globus commented 1 week ago

What?

Why?

  1. ClientApps don't have the same token refresh erganomics as UserApps.
    • If an access token is expired in a UserApp, it will raise an error which can be by the app and initiate a login flow.
    • If an access token is expired in a ClientApp, it will still return a ClientCredentialAuthorizer expecting that the access token will be refreshed by that authorizer down the line.
  2. ClientCredentialAuthorizers exclusively request one token at a time.

Because of these two facts, a refresh initiated by a ClientCredentialAuthorizer will only ever contain identity info if it's refreshing specifically an globus auth token because that identity info only comes if you specify the special auth-managed "openid" scope.

Because this is a pretty widespread bug (any usage of a ClientApp), I advocate that we simply remove identity id consistency validation from ClientApps (thank you @rjmello for this suggestion) while planning to move off of ClientCredntialAuthorizer in the future.

Testing

  1. Added a unit test that recreates a scenario users reported. Verified it failed before the fix & succeeded after it.
  2. Simulated a client app token expiry scenario locally & observed that the groups token was successfully refreshed.