summaryrefslogtreecommitdiff
path: root/pkg/web/open_id_configuration.go
blob: 8c1f49e83c46ac29da830f3c59aab2f4a9fae5e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package web

import (
	_ "embed"
	"net/http"
	"text/template"
)

//go:embed templates/openid-configuration.json
var oidcConfig string

var (
	tmpl = template.Must(template.New("").Parse(string(oidcConfig)))
)

func (h *HttpContext) OpenIdConfiguration(w http.ResponseWriter, r *http.Request) {
	w.Header().Set("Content-Type", "application/json")
	tmpl.Execute(w, struct{ Issuer string }{Issuer: h.cfg.Issuer})
}