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

Add asymmetric JWT signing #16010

Merged
merged 16 commits into from
Jun 17, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
lint
KN4CK3R committed May 29, 2021
commit 0ae9106a6abbb4be4d220ad225aabd38dcee7b2b
4 changes: 2 additions & 2 deletions modules/auth/oauth2/jwtsigningkey.go
Original file line number Diff line number Diff line change
@@ -83,7 +83,7 @@ func (key rsaSingingKey) VerifyKey() interface{} {
func (key rsaSingingKey) ToJSON() map[string]string {
pubKey := key.key.Public().(*rsa.PublicKey)

return map[string]string {
return map[string]string{
"kty": "RSA",
"alg": key.SigningMethod().Alg(),
"e": base64.RawURLEncoding.EncodeToString(big.NewInt(int64(pubKey.E)).Bytes()),
@@ -115,7 +115,7 @@ func (key ecdsaSingingKey) VerifyKey() interface{} {
func (key ecdsaSingingKey) ToJSON() map[string]string {
pubKey := key.key.Public().(*ecdsa.PublicKey)

return map[string]string {
return map[string]string{
"kty": "EC",
"alg": key.SigningMethod().Alg(),
"crv": pubKey.Params().Name,
4 changes: 2 additions & 2 deletions routers/user/oauth.go
Original file line number Diff line number Diff line change
@@ -465,8 +465,8 @@ func OIDCKeys(ctx *context.Context) {
keyJSON := oauth2.DefaultSigningKey.ToJSON()
keyJSON["use"] = "sig"

jwkSet := map[string][]map[string]string {
"keys": []map[string]string {
jwkSet := map[string][]map[string]string{
"keys": {
keyJSON,
},
}