Fix log sensitive info
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
@@ -70,7 +70,7 @@ func SAMLACSHandler(samlSvc *authsvc.SAMLService, authSvc *authsvc.Service, auth
|
|||||||
|
|
||||||
user, err := authSvc.CreateOrGetSAMLUser(ctx, userInfo.Email, userInfo.FullName, userInfo.SAMLSubject)
|
user, err := authSvc.CreateOrGetSAMLUser(ctx, userInfo.Email, userInfo.FullName, userInfo.SAMLSubject)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.ErrorCtx(ctx, "cannot create or get SAML user", log.Error(err), log.String("email", userInfo.Email))
|
logger.ErrorCtx(ctx, "cannot create or get SAML user", log.Error(err))
|
||||||
http.Error(w, "cannot create user", http.StatusInternalServerError)
|
http.Error(w, "cannot create user", http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ func SAMLCheckSSOHandler(authSvc *authsvc.Service, logger *log.Logger) http.Hand
|
|||||||
|
|
||||||
configs, err := authSvc.CheckSSOAvailabilityByEmail(ctx, req.Email)
|
configs, err := authSvc.CheckSSOAvailabilityByEmail(ctx, req.Email)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.ErrorCtx(ctx, "cannot check SSO availability", log.Error(err), log.String("email", req.Email))
|
logger.ErrorCtx(ctx, "cannot check SSO availability", log.Error(err))
|
||||||
httpserver.RenderError(w, http.StatusInternalServerError, fmt.Errorf("cannot check SSO availability"))
|
httpserver.RenderError(w, http.StatusInternalServerError, fmt.Errorf("cannot check SSO availability"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -69,7 +69,7 @@ func SAMLCheckSSOHandler(authSvc *authsvc.Service, logger *log.Logger) http.Hand
|
|||||||
|
|
||||||
// Multiple SAML configs found - ambiguous, user must use organization-specific SSO URL
|
// Multiple SAML configs found - ambiguous, user must use organization-specific SSO URL
|
||||||
if len(configs) > 1 {
|
if len(configs) > 1 {
|
||||||
logger.WarnCtx(ctx, "multiple SAML configurations found for domain", log.String("email", req.Email), log.Int("count", len(configs)))
|
logger.WarnCtx(ctx, "multiple SAML configurations found for domain", log.Int("count", len(configs)))
|
||||||
httpserver.RenderError(w, http.StatusConflict, fmt.Errorf("multiple SSO configurations found for this domain. Please use your organization-specific SSO login URL"))
|
httpserver.RenderError(w, http.StatusConflict, fmt.Errorf("multiple SSO configurations found for this domain. Please use your organization-specific SSO login URL"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,12 +53,12 @@ func SAMLLoginHandler(samlSvc *authsvc.SAMLService, authSvc *authsvc.Service, lo
|
|||||||
|
|
||||||
redirectURL, err := samlSvc.InitiateSAMLLogin(ctx, config.OrganizationID, tenantID, config.EmailDomain)
|
redirectURL, err := samlSvc.InitiateSAMLLogin(ctx, config.OrganizationID, tenantID, config.EmailDomain)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.ErrorCtx(ctx, "cannot initiate SAML login", log.Error(err), log.String("saml_config_id", samlConfigID.String()), log.String("org_id", config.OrganizationID.String()), log.String("email_domain", config.EmailDomain))
|
logger.ErrorCtx(ctx, "cannot initiate SAML login", log.Error(err), log.String("saml_config_id", samlConfigID.String()), log.String("org_id", config.OrganizationID.String()))
|
||||||
http.Error(w, fmt.Sprintf("SAML login failed: %v", err), http.StatusInternalServerError)
|
http.Error(w, fmt.Sprintf("SAML login failed: %v", err), http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.InfoCtx(ctx, "SAML login initiated", log.String("saml_config_id", samlConfigID.String()), log.String("org_id", config.OrganizationID.String()), log.String("email_domain", config.EmailDomain))
|
logger.InfoCtx(ctx, "SAML login initiated", log.String("saml_config_id", samlConfigID.String()), log.String("org_id", config.OrganizationID.String()))
|
||||||
|
|
||||||
http.Redirect(w, r, redirectURL, http.StatusFound)
|
http.Redirect(w, r, redirectURL, http.StatusFound)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user