...
1 package oauth2
2
3 import (
4 "crypto/x509"
5 "net/http"
6
7 "edge-infra.dev/pkg/edge/iam/config"
8
9 "github.com/gin-gonic/gin"
10 "gopkg.in/square/go-jose.v2"
11 )
12
13 func (oauth2 *OAuth2) jwks(ctx *gin.Context) {
14
15 jwks := &jose.JSONWebKeySet{
16 Keys: []jose.JSONWebKey{
17 {
18 Algorithm: "RS256",
19 Key: config.PrivateKey().Public(),
20 Use: "sig",
21 KeyID: config.PrivateKeyID(),
22 Certificates: []*x509.Certificate{},
23 CertificateThumbprintSHA1: []uint8{},
24 CertificateThumbprintSHA256: []uint8{},
25 },
26 },
27 }
28 ctx.JSON(http.StatusOK, jwks)
29 }
30
View as plain text