mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
4ebd8fdf4e
This adjusts the CORS headers appropriately for OpenID Connect. This includes responding to OPTIONS requests appropriately. Currently this is only configured to operate when the Origin scheme is HTTPS; but can easily be expanded in the future to include additional Origins.
17 lines
454 B
Go
17 lines
454 B
Go
package handlers
|
|
|
|
import (
|
|
"encoding/json"
|
|
|
|
"github.com/authelia/authelia/v4/internal/middlewares"
|
|
)
|
|
|
|
// JSONWebKeySetGET returns the JSON Web Key Set. Used in OAuth 2.0 and OpenID Connect 1.0.
|
|
func JSONWebKeySetGET(ctx *middlewares.AutheliaCtx) {
|
|
ctx.SetContentType("application/json")
|
|
|
|
if err := json.NewEncoder(ctx).Encode(ctx.Providers.OpenIDConnect.KeyManager.GetKeySet()); err != nil {
|
|
ctx.Error(err, "failed to serve json web key set")
|
|
}
|
|
}
|