Test App: logout flow

This commit is contained in:
2020-05-26 11:17:16 +02:00
parent 467116524d
commit 9ff00c3f59
8 changed files with 69 additions and 31 deletions

View File

@ -13,7 +13,6 @@ func handleLogout(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
ctn := container.Must(ctx)
conf := config.Must(ctn)
client := oidc.Must(ctn)
logger.Info(

View File

@ -19,13 +19,25 @@ func serveProfilePage(w http.ResponseWriter, r *http.Request) {
panic(errors.Wrap(err, "could not retrieve idToken"))
}
claims := make(map[string]interface{})
if err := idToken.Claims(&claims); err != nil {
panic(errors.Wrap(err, "could not decode claims"))
}
jsonIDToken, err := json.MarshalIndent(idToken, "", " ")
if err != nil {
panic(errors.Wrap(err, "could not encode idToken"))
}
jsonClaims, err := json.MarshalIndent(claims, "", " ")
if err != nil {
panic(errors.Wrap(err, "could not encode claims"))
}
data := extendTemplateData(w, r, template.Data{
"IDToken": idToken,
"Claims": claims,
"JSONClaims": string(jsonClaims),
"JSONIDToken": string(jsonIDToken),
})