Skip to content

Commit

Permalink
chore(provider): add provider name to error message
Browse files Browse the repository at this point in the history
adds the idp config provider name to error message when
the provider host cannot be parsed from metadata url or
fetching metadata document fails.

Closes: #1445
  • Loading branch information
Stefan Jacobi committed May 29, 2024
1 parent c4e31bd commit 30dfdb1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions backend/ee/saml/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ func NewSamlHandler(cfg *config.Config, persister persistence.Persister, session
providers := make([]provider.ServiceProvider, 0)
for _, idpConfig := range cfg.Saml.IdentityProviders {
if idpConfig.Enabled {
name := ""
name, err := parseProviderFromMetadataUrl(idpConfig.MetadataUrl)
hostName := ""
hostName, err := parseProviderFromMetadataUrl(idpConfig.MetadataUrl)
if err != nil {
fmt.Printf("failed to parse provider from metadata url: %v\n", err)
fmt.Printf("failed to parse provider '%s' from metadata url: %v\n", idpConfig.Name, err)
continue
}

newProvider, err := provider.GetProvider(name, cfg, idpConfig, persister.GetSamlCertificatePersister())
newProvider, err := provider.GetProvider(hostName, cfg, idpConfig, persister.GetSamlCertificatePersister())
if err != nil {
fmt.Printf("failed to initialize provider: %v\n", err)
fmt.Printf("failed to initialize provider '%s': %v\n", idpConfig.Name, err)
continue
}

Expand Down

0 comments on commit 30dfdb1

Please sign in to comment.