fixes and formatting

This commit is contained in:
Kim Tore Jensen
2021-08-19 11:39:16 +02:00
parent 956cda2a40
commit 60ce40e404
2 changed files with 16 additions and 15 deletions

View File

@@ -15,24 +15,24 @@ type Config struct {
}
type IDPorten struct {
ClientID string `json:"client-id"`
ClientJWK string `json:"client-jwk"`
RedirectURI string `json:"redirect-uri"`
WellKnownURL string `json:"well-known-url"`
WellKnown IDPortenWellKnown `json:"well-known"`
Locale string `json:"locale"`
SecurityLevel string `json:"security-level"`
ClientID string `json:"client-id"`
ClientJWK string `json:"client-jwk"`
RedirectURI string `json:"redirect-uri"`
WellKnownURL string `json:"well-known-url"`
WellKnown IDPortenWellKnown `json:"well-known"`
Locale string `json:"locale"`
SecurityLevel string `json:"security-level"`
}
const (
BindAddress = "bind-address"
LogFormat = "log-format"
LogLevel = "log-level"
IDPortenClientID = "idporten.client-id"
IDPortenClientJWK = "idporten.client-jwk"
IDPortenRedirectURI = "idporten.redirect-uri"
IDPortenWellKnownURL = "idporten.well-known-url"
IDPortenLocale = "idporten.locale"
BindAddress = "bind-address"
LogFormat = "log-format"
LogLevel = "log-level"
IDPortenClientID = "idporten.client-id"
IDPortenClientJWK = "idporten.client-jwk"
IDPortenRedirectURI = "idporten.redirect-uri"
IDPortenWellKnownURL = "idporten.well-known-url"
IDPortenLocale = "idporten.locale"
IDPortenSecurityLevel = "idporten.security-level"
)

View File

@@ -38,6 +38,7 @@ func (h *Handler) Login(w http.ResponseWriter, r *http.Request) {
randomUUID2, err := uuid.NewRandom()
if err != nil {
http.Error(w, "failed to create nonce: "+err.Error(), http.StatusUnauthorized)
return
}
nonce := randomUUID2.String()