2021-05-04 22:06:05 +00:00
|
|
|
package handlers
|
|
|
|
|
|
|
|
import (
|
|
|
|
"encoding/json"
|
|
|
|
|
2021-08-11 01:04:35 +00:00
|
|
|
"github.com/authelia/authelia/v4/internal/middlewares"
|
2021-05-04 22:06:05 +00:00
|
|
|
)
|
|
|
|
|
2022-04-07 00:58:51 +00:00
|
|
|
// JSONWebKeySetGET returns the JSON Web Key Set. Used in OAuth 2.0 and OpenID Connect 1.0.
|
|
|
|
func JSONWebKeySetGET(ctx *middlewares.AutheliaCtx) {
|
2023-04-19 04:24:05 +00:00
|
|
|
ctx.SetContentTypeApplicationJSON()
|
2021-05-04 22:06:05 +00:00
|
|
|
|
2023-04-19 04:24:05 +00:00
|
|
|
if err := json.NewEncoder(ctx).Encode(ctx.Providers.OpenIDConnect.KeyManager.Set(ctx)); err != nil {
|
2022-03-15 22:55:38 +00:00
|
|
|
ctx.Error(err, "failed to serve json web key set")
|
2021-05-04 22:06:05 +00:00
|
|
|
}
|
|
|
|
}
|