Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auth with PKCE #13

Closed
nzoschke opened this issue May 13, 2023 · 1 comment · Fixed by #14
Closed

Auth with PKCE #13

nzoschke opened this issue May 13, 2023 · 1 comment · Fixed by #14

Comments

@nzoschke
Copy link
Contributor

nzoschke commented May 13, 2023

Great project, I got the first version of an supabase auth provider working in 5 minutes. However its using implicit flow, so the access_token is in a URL fragment and not available on the server side.

From the auth server side rendering docs, I need to configure the auth client to use PKCE flow by setting the flowType: 'pkce' some how.

I'm thinking this will either be a new option on ProviderSignInOptions or to CreateClient.

I plan to work on this an open a PR, but starting with an issue here in case anyone else has the problem or knows the solution.

@nzoschke
Copy link
Contributor Author

I found the JS bits around here: https://github.com/supabase/gotrue-js/blob/master/src/GoTrueClient.ts#L1509

Looks like supabase-go will need to construct the /authorize URL with pkce params.

Some breadcrumbs for doing this with the Go oauth package are here: golang/oauth2#603

@nzoschke nzoschke mentioned this issue May 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant