Skip to content

4879: Provide the Authentication error with token type and scopes #4880

@sergeibbb

Description

@sergeibbb

Provide token type and scopes, to the Authentication error, so when it happen it's easier for us to reproduce

GK gives us information of whether the token is PAT or OAuth. Also when we get the VSCode's GitHub token we can know it as well.

To sum up, when an AuthenticationError appears in log we want to see:

  • integration type
  • token type
  • scopes

Steps to reproduce

  • Connect a GitHub integration
  • Go to GitHub.com authorized applications settings and revoke the application
  • Navigate git content in GitLens until you start seeing Authentication errors:
    Error: Your 'github' credentials are either invalid or expired
    
  • We want to add more details there, for example, if we've sent user through the re-authentication flow we want to know whether it helps or not.

Verification

Example of a produced error log after the improvement:

Error: Your 'github' credentials are either invalid or expired (token details: self-managed, @4cb, [repo,read:user,user:email])

or

Error: Your 'github' credentials are either invalid or expired (token details: cloud,  oauth, @e75, expires at 2060-01-30T03:52:47.500Z, [repo,read:user,user:email])
  • real token does not appear in logs
  • undefined values do not pollute the message, e.g. you do not see something like this:
    (token details: self-managed, , cloud, , [repo])
    
  • While additional info is presented in logs, it does not pollute the pop-up message:
    Image
    Image
  • Make sure that the Graph keeps working, e.g. github.searchCommitShas() has been affected by the change, so it's worth to check that it's not broken.
  • Make sure that various paged results keep working, since the providersApi.ts -> ProvidersApi.getPagedResult() is affected too.

Metadata

Metadata

Assignees

Labels

integration-githubIssues or features related to GitHub integrationsneeds-verificationRequest for verification

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions