mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-12 17:09:03 +08:00
fix(saml): handle invalid email domain (#5580)
### Summary Handle the scenario when email with domain is used for SSO Login which does not match authenticated domains. Signed-off-by: Prashant Shahi <prashant@signoz.io>
This commit is contained in:
parent
a688b6c60e
commit
4360cd0397
@ -20,11 +20,14 @@ import (
|
|||||||
func (m *modelDao) createUserForSAMLRequest(ctx context.Context, email string) (*basemodel.User, basemodel.BaseApiError) {
|
func (m *modelDao) createUserForSAMLRequest(ctx context.Context, email string) (*basemodel.User, basemodel.BaseApiError) {
|
||||||
// get auth domain from email domain
|
// get auth domain from email domain
|
||||||
domain, apierr := m.GetDomainByEmail(ctx, email)
|
domain, apierr := m.GetDomainByEmail(ctx, email)
|
||||||
|
|
||||||
if apierr != nil {
|
if apierr != nil {
|
||||||
zap.L().Error("failed to get domain from email", zap.Error(apierr))
|
zap.L().Error("failed to get domain from email", zap.Error(apierr))
|
||||||
return nil, model.InternalErrorStr("failed to get domain from email")
|
return nil, model.InternalErrorStr("failed to get domain from email")
|
||||||
}
|
}
|
||||||
|
if domain == nil {
|
||||||
|
zap.L().Error("email domain does not match any authenticated domain", zap.String("email", email))
|
||||||
|
return nil, model.InternalErrorStr("email domain does not match any authenticated domain")
|
||||||
|
}
|
||||||
|
|
||||||
hash, err := baseauth.PasswordHash(utils.GeneratePassowrd())
|
hash, err := baseauth.PasswordHash(utils.GeneratePassowrd())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user