From 8dfaa1dfa5e193d494a1f4df85e2d4b0e6605128 Mon Sep 17 00:00:00 2001 From: Stefan Benz <46600784+stebenz@users.noreply.github.com> Date: Thu, 15 Jun 2023 11:04:27 +0200 Subject: [PATCH] fix: check if application is active in saml logic (#6003) Co-authored-by: Livio Spring --- internal/api/saml/storage.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/api/saml/storage.go b/internal/api/saml/storage.go index b47b321ad..45686d6ad 100644 --- a/internal/api/saml/storage.go +++ b/internal/api/saml/storage.go @@ -53,6 +53,9 @@ func (p *Storage) GetEntityByID(ctx context.Context, entityID string) (*servicep if err != nil { return nil, err } + if app.State != domain.AppStateActive { + return nil, errors.ThrowPreconditionFailed(nil, "SAML-sdaGg", "app is not active") + } return serviceprovider.NewServiceProvider( app.ID, &serviceprovider.Config{ @@ -67,6 +70,9 @@ func (p *Storage) GetEntityIDByAppID(ctx context.Context, appID string) (string, if err != nil { return "", err } + if app.State != domain.AppStateActive { + return "", errors.ThrowPreconditionFailed(nil, "SAML-sdaGg", "app is not active") + } return app.SAMLConfig.EntityID, nil }