nikku / wuffle

A multi-repository / multi-organization task board for GitHub issues.
https://wuffle.dev
MIT License
118 stars 23 forks source link

Board user should be logged out on backend GitHub authentication error #85

Closed nikku closed 3 years ago

nikku commented 4 years ago

Describe the Bug

In certain circumstances it may happen that the GitHub authentication is invalidated.

That leads to errors if the client loads the board, i.e. this one:

failed to create read filter, defaulting to public read RequestError [HttpError]: Resource protected by organization SAML enforcement. You must grant your personal token access to this organization.
    at /app/packages/app/node_modules/@octokit/request/dist-node/index.js:66:23
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async Job.doExecute (/app/packages/app/node_modules/bottleneck/light.js:405:18) {
  name: 'HttpError',
  status: 403,
  headers: {
    'access-control-allow-origin': '*',
    'access-control-expose-headers': 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset',
    connection: 'close',
    'content-encoding': 'gzip',
    'content-security-policy': "default-src 'none'",
    'content-type': 'application/json; charset=utf-8',
    date: 'Tue, 31 Mar 2020 13:14:54 GMT',
    'referrer-policy': 'origin-when-cross-origin, strict-origin-when-cross-origin',
    server: 'GitHub.com',
    status: '403 Forbidden',
    'strict-transport-security': 'max-age=31536000; includeSubdomains; preload',
    'transfer-encoding': 'chunked',
    vary: 'Accept-Encoding, Accept, X-Requested-With',
    'x-accepted-oauth-scopes': 'read:user, user',
    'x-content-type-options': 'nosniff',
    'x-frame-options': 'deny',
    'x-github-media-type': 'github.machine-man-preview; format=json',
    'x-github-request-id': '...',
    'x-github-sso': 'required; url=...',
    'x-oauth-client-id': '...',
    'x-oauth-scopes': '',
    'x-ratelimit-limit': '5000',
    'x-ratelimit-remaining': '3982',
    'x-ratelimit-reset': '1585661068',
    'x-xss-protection': '1; mode=block'
  },
  request: {
    method: 'GET',
    url: '...',
    headers: {
      accept: 'application/vnd.github.machine-man-preview+json',
      'user-agent': 'octokit.js/16.35.0 Node.js/13.8.0 (Linux 4.4; x64)',
      authorization: 'token [REDACTED]'
    },
    request: { hook: [Function: bound bound register], retryCount: 1 }
  },
  documentation_url: 'https://help.github.com/articles/authenticating-to-a-github-organization-with-saml-single-sign-on/'
}

Steps to Reproduce

None, unfortunately :cry:

Expected Behavior

Environment

nikku commented 4 years ago

Seems to be related to additional authentication steps if SSO is enabled for an organization, cf. GitHub documentation.

nikku commented 3 years ago

Closing this as cannot reproduce.