-
Notifications
You must be signed in to change notification settings - Fork 268
feat: support jwt signing keys for local auth #3841
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
feat: support jwt signing keys for local auth #3841
Conversation
Pull Request Test Coverage Report for Build 16416756141Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks OK to me, however you may want to explore a jwk
library if you want.
Maybe the default output format should be the key, while passing another parameter to give you the config.toml setting? Reason being this command can be used for people who want to import a private key they control. |
generate-key
cmd for generating jwt signing keyse23950b
to
edf8d7e
Compare
f6a01d7
to
0cbcee0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
} | ||
out = f | ||
} | ||
jwkArray = append(jwkArray, keyPair.PrivateKey) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cemalkilic do we need to show or save the public key to user?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think at this point, no.
internal/start/start.go
Outdated
|
||
// Add JWT keys from file if configured | ||
if keysData, err := utils.Config.Auth.GetSigningKeysData(fsys); err == nil && keysData != "" { | ||
env = append(env, "GOTRUE_JWT_KEYS="+keysData) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cemalkilic can we add the jwks parsed from line 148 directly here?
"GOTRUE_JWT_SECRET=" + utils.Config.Auth.JwtSecret.Value,
"GOTRUE_JWT_KEYS=" + jwks,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, that jwks
is consumed by the other services (storage, realtime etc) to accept tokens from the third party auth (docs).
Supabase Auth server shouldn't serve the JWKS of the third party auth providers.
62c58f7
to
df6a75f
Compare
is there an easy way to track when this will be available as docker gotrue image? Happy to instantly use it ;-) |
What kind of change does this PR introduce?
command to generate jwt signing keys & spin up auth server with the configured JWK keys
Steps
supabase gen signing-key ES256
signing_keys_path
line in theconfig.toml
.http://localhost:54321/auth/v1/.well-known/jwks.json
Command output
Run with
--append
flag