mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
Add openid-configuration
just for jwks_uri
(for jwt.io)
This commit is contained in:
parent
9dc1087273
commit
161e4943a1
10
auth/jwt.go
10
auth/jwt.go
@ -74,7 +74,7 @@ func (h *Handler) CreateJwt(c echo.Context) error {
|
||||
// @Produce json
|
||||
// @Success 200 {object} jwk.Key
|
||||
// @Router /.well-known/jwks.json [get]
|
||||
func (h *Handler) GetInfo(c echo.Context) error {
|
||||
func (h *Handler) GetJwks(c echo.Context) error {
|
||||
key, err := jwk.New(h.config.JwtPublicKey)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -86,3 +86,11 @@ func (h *Handler) GetInfo(c echo.Context) error {
|
||||
set.Add(key)
|
||||
return c.JSON(200, set)
|
||||
}
|
||||
|
||||
func (h *Handler) GetOidcConfig(c echo.Context) error {
|
||||
return c.JSON(200, struct {
|
||||
JwksUri string `json:"jwks_uri"`
|
||||
}{
|
||||
JwksUri: fmt.Sprintf("%s/.well-known/jwks.json", h.config.PublicUrl),
|
||||
})
|
||||
}
|
||||
|
@ -184,7 +184,8 @@ func main() {
|
||||
r.DELETE("/sessions/:id", h.Logout)
|
||||
|
||||
g.GET("/jwt", h.CreateJwt)
|
||||
e.GET("/.well-known/jwks.json", h.GetInfo)
|
||||
e.GET("/.well-known/jwks.json", h.GetJwks)
|
||||
e.GET("/.well-known/openid-configuration", h.GetOidcConfig)
|
||||
|
||||
g.GET("/swagger/*", echoSwagger.WrapHandler)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user