Add IDP initiated flow support

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2025-11-12 09:06:02 +01:00
parent 5b6016c817
commit edce70141d
2 changed files with 123 additions and 82 deletions

View File

@@ -60,10 +60,13 @@ func SAMLACSHandler(samlSvc *authsvc.SAMLService, authSvc *authsvc.Service, auth
return
}
if r.FormValue("RelayState") == "" {
logger.WarnCtx(ctx, "missing RelayState")
http.Error(w, "missing RelayState", http.StatusBadRequest)
return
relayState := r.FormValue("RelayState")
samlConfigID := r.URL.Query().Get("c")
if relayState != "" {
logger.InfoCtx(ctx, "processing SP-initiated SAML login", log.String("relay_state", relayState))
} else {
logger.InfoCtx(ctx, "processing IDP-initiated SAML login", log.String("config_id", samlConfigID))
}
userInfo, err := samlSvc.HandleSAMLAssertion(ctx, r)