docs icon indicating copy to clipboard operation
docs copied to clipboard

The Authorizing OAuth Apps doesn't mention the access_token endpoint doesn't support CORS

Open baywet opened this issue 2 years ago • 6 comments

Code of Conduct

What article on docs.github.com is affected?

https://docs.github.com/en/developers/apps/building-oauth-apps/authorizing-oauth-apps#2-users-are-redirected-back-to-your-site-by-github

What part(s) of the article would you like to see updated?

There should be a mention that CORS pre-flights are not supported on this endpoint (OPTIONS requests). This, and the fact that implicit flow is not supported, effectively means that authenticating from a SPA is impossible without a service relay. That's unless PKCE is supported, but there are no mentions of it. https://espressocoder.com/2019/10/28/secure-your-spa-with-authorization-code-flow-with-pkce/

Additional information

No response

baywet avatar Nov 24 '22 16:11 baywet

Thanks for opening this issue. A GitHub docs team member should be by to give feedback soon. In the meantime, please check out the contributing guidelines.

welcome[bot] avatar Nov 24 '22 16:11 welcome[bot]

@baywet Thanks so much for opening an issue! I'll triage this for the team to take a look :eyes:

cmwilson21 avatar Nov 25 '22 16:11 cmwilson21

Thanks! For information after investigating the issue further I also established that PKCE isn't supported today. This should probably be detailed in the docs as well. I've added a "feature request" here which contains additional details.

baywet avatar Nov 25 '22 17:11 baywet

Thanks for opening an issue! We've triaged this issue for technical review by a subject matter expert :eyes:

github-actions[bot] avatar Nov 29 '22 01:11 github-actions[bot]

This is a gentle bump for the docs team that this issue is waiting for technical review.

github-actions[bot] avatar Dec 27 '22 16:12 github-actions[bot]

This is a gentle bump for the docs team that this issue is waiting for technical review.

github-actions[bot] avatar Jan 25 '23 16:01 github-actions[bot]

This is a gentle bump for the docs team that this issue is waiting for technical review.

github-actions[bot] avatar Feb 23 '23 16:02 github-actions[bot]

This is a gentle bump for the docs team that this issue is waiting for technical review.

github-actions[bot] avatar Mar 24 '23 16:03 github-actions[bot]

Cross-referencing https://github.com/github/docs/pull/24965 which is a PR to mention that PKCE is not supported.

steveward avatar Apr 12 '23 15:04 steveward

@github/ecosystem-apps-reviewers could you review this from a technical perspective?

skedwards88 avatar Apr 25 '23 19:04 skedwards88

@skedwards88 just to clarify, are you asking for review of the cross-referenced PR? Or something else?

jamesmartin avatar May 01 '23 07:05 jamesmartin

Thanks for asking @jamesmartin . Should we additionally need to document this part (below), or does https://github.com/github/docs/pull/24965 cover everything that this issue is asking for?

There should be a mention that CORS pre-flights are not supported on this endpoint (OPTIONS requests). This, and the fact that implicit flow is not supported, effectively means that authenticating from a SPA is impossible without a service relay.

skedwards88 avatar May 01 '23 16:05 skedwards88

Thanks for clarifying, @skedwards. I think #24965 only covers the additional discovery that PKCE is not supported. The fact that we block OPTIONS requests, and therefore CORS preflight requests don't work, could also be documented to help developers of SPAs that depend on this type of authorization code flow.

jamesmartin avatar May 01 '23 20:05 jamesmartin

Thanks for confirming!

@baywet you or anyone else is welcome to open a PR to document this info.

skedwards88 avatar May 01 '23 21:05 skedwards88

Thanks for providing more clarity. Documenting the feature gap is a first step in the right direction, but ultimately I'd like to see the gap addressed in the service. Before I make any documentation change, how can I request the feature formally?

baywet avatar May 13 '23 21:05 baywet

Before I make any documentation change, how can I request the feature formally?

We're tracking this feature internally and the discussion here has already been helpful to bring fresh perspectives to the issue. We don't have anything to announce right now as far as roadmaps go, however.

jamesmartin avatar May 15 '23 03:05 jamesmartin

@jamesmartin great! Thank you for helping prioritize this set of features! Here is an additional PR to document the CORS gap. #25563

baywet avatar May 15 '23 13:05 baywet