forked from kevadesu/forgejo
Add EdDSA JWT signing algorithm (#16786)
* Add EdDSA signing algorithm * Fix typo Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
parent
29b971b6d5
commit
28ac4a7a87
4 changed files with 76 additions and 9 deletions
|
@ -546,7 +546,7 @@ func AccessTokenOAuth(ctx *context.Context) {
|
|||
|
||||
signingKey := oauth2.DefaultSigningKey
|
||||
if signingKey.IsSymmetric() {
|
||||
clientKey, err := oauth2.CreateJWTSingingKey(signingKey.SigningMethod().Alg(), []byte(form.ClientSecret))
|
||||
clientKey, err := oauth2.CreateJWTSigningKey(signingKey.SigningMethod().Alg(), []byte(form.ClientSecret))
|
||||
if err != nil {
|
||||
handleAccessTokenError(ctx, AccessTokenError{
|
||||
ErrorCode: AccessTokenErrorCodeInvalidRequest,
|
||||
|
|
|
@ -15,7 +15,7 @@ import (
|
|||
)
|
||||
|
||||
func createAndParseToken(t *testing.T, grant *models.OAuth2Grant) *oauth2.OIDCToken {
|
||||
signingKey, err := oauth2.CreateJWTSingingKey("HS256", make([]byte, 32))
|
||||
signingKey, err := oauth2.CreateJWTSigningKey("HS256", make([]byte, 32))
|
||||
assert.NoError(t, err)
|
||||
assert.NotNil(t, signingKey)
|
||||
oauth2.DefaultSigningKey = signingKey
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue