diff --git a/packages/backend/src/graphql/schema.graphql b/packages/backend/src/graphql/schema.graphql index 96974fa816..4237bc842c 100644 --- a/packages/backend/src/graphql/schema.graphql +++ b/packages/backend/src/graphql/schema.graphql @@ -720,6 +720,7 @@ type ListSamlAuthProvider { id: String name: String issuer: String + loginUrl: String } type Permission { diff --git a/packages/backend/src/models/saml-auth-provider.ee.ts b/packages/backend/src/models/saml-auth-provider.ee.ts index 1541eb810f..075c87ebbf 100644 --- a/packages/backend/src/models/saml-auth-provider.ee.ts +++ b/packages/backend/src/models/saml-auth-provider.ee.ts @@ -75,6 +75,14 @@ class SamlAuthProvider extends Base { }, }); + static get virtualAttributes() { + return ['loginUrl']; + } + + get loginUrl() { + return new URL(`/login/saml/${this.issuer}`, appConfig.baseUrl).toString(); + } + get config(): SamlConfig { const callbackUrl = new URL( `/login/saml/${this.issuer}/callback`, diff --git a/packages/types/index.d.ts b/packages/types/index.d.ts index 2aa1ddb83e..76b7aa6e35 100644 --- a/packages/types/index.d.ts +++ b/packages/types/index.d.ts @@ -427,6 +427,7 @@ type TSamlAuthProvider = { roleAttributeName: string; defaultRoleId: string; active: boolean; + loginUrl: string; }; type AppConfig = { @@ -437,7 +438,7 @@ type AppConfig = { canCustomConnect: boolean; shared: boolean; disabled: boolean; -} +}; type AppAuthClient = { id: string; @@ -445,7 +446,7 @@ type AppAuthClient = { appConfigId: string; authDefaults: string; formattedAuthDefaults: IJSONObject; -} +}; declare module 'axios' { interface AxiosResponse { diff --git a/packages/web/.env-example b/packages/web/.env-example index e1d9669336..003236c060 100644 --- a/packages/web/.env-example +++ b/packages/web/.env-example @@ -1,5 +1,4 @@ PORT=3001 -REACT_APP_API_URL=http://localhost:3000 REACT_APP_GRAPHQL_URL=http://localhost:3000/graphql # HTTPS=true REACT_APP_BASE_URL=http://localhost:3001 diff --git a/packages/web/src/components/SsoProviders/index.ee.tsx b/packages/web/src/components/SsoProviders/index.ee.tsx index 13f5b2fe6a..7617c30dc4 100644 --- a/packages/web/src/components/SsoProviders/index.ee.tsx +++ b/packages/web/src/components/SsoProviders/index.ee.tsx @@ -24,7 +24,7 @@ function SsoProviders() {