Skip to content

Commit

Permalink
BED-4921 fix: missing entity id for saml provider (#935)
Browse files Browse the repository at this point in the history
  • Loading branch information
mistahj67 authored Nov 6, 2024
1 parent 36170aa commit 71e49c8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions cmd/api/src/api/v2/auth/saml.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ func serviceProviderFactory(ctx context.Context, cfg config.Configuration, samlP
} else if idpMetadata, err := samlsp.ParseMetadata(samlProvider.MetadataXML); err != nil {
return bhsaml.ServiceProvider{}, fmt.Errorf("failed to parse metadata XML for service provider %s: %w", samlProvider.Name, err)
} else {
// This is required to populate the samlProvider.ServiceProviderIssuerURI
samlProvider = bhsaml.FormatSAMLProviderURLs(ctx, samlProvider)[0]
return bhsaml.NewServiceProvider(samlProvider, bhsaml.FormatServiceProviderURLs(*bhCtx.Get(ctx).Host, samlProvider.Name), samlsp.Options{
EntityID: samlProvider.ServiceProviderIssuerURI.String(),
URL: samlProvider.ServiceProviderIssuerURI.AsURL(),
Expand Down
2 changes: 1 addition & 1 deletion cmd/ui/src/views/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const Login: React.FC = () => {
);
}

if (listSSOProvidersQuery.isError || listSSOProvidersQuery.data?.length === 0) {
if (listSSOProvidersQuery.isError || !listSSOProvidersQuery.data) {
return (
<LoginPage>
<LoginForm onSubmit={handleSubmitLoginForm} loading={authState.loginLoading} />
Expand Down

0 comments on commit 71e49c8

Please sign in to comment.