diff --git a/.env.example b/.env.example index eee3ee84..af51ebba 100644 --- a/.env.example +++ b/.env.example @@ -2,18 +2,9 @@ VITE_API_URL=https://mvj.dev.hel.ninja/v1 VITE_STORAGE_PREFIX=MVJ PORT=3000 -# Helsinki Tunnistamo (legacy) -VITE_OPENID_CONNECT_API_TOKEN_KEY=https://api.hel.fi/auth/mvj -VITE_OPENID_CONNECT_API_TOKEN_URL=https://api.hel.fi/sso/api-tokens/ -VITE_OPENID_CONNECT_AUTHORITY_URL=https://api.hel.fi/sso/openid/ -VITE_OPENID_CONNECT_CLIENT_ID=https://api.hel.fi/auth/mvj -VITE_OPENID_CONNECT_SCOPE=openid profile mvj https://api.hel.fi/auth/mvj # Helsinki Tunnistus VITE_TUNNISTUS_OIDC_CLIENT_ID=mvj-admin-ui-dev VITE_TUNNISTUS_OIDC_AUTHORITY_URL=https://tunnistus.test.hel.ninja/auth/realms/helsinki-tunnistus VITE_TUNNISTUS_OIDC_SCOPE=openid profile VITE_TUNNISTUS_OIDC_API_AUDIENCE=mvj-api-dev VITE_TUNNISTUS_OIDC_API_TOKEN_URL=https://tunnistus.test.hel.ninja/auth/realms/helsinki-tunnistus/protocol/openid-connect/token -# Use legacy Tunnistamo SSO, or Tunnistus SSO? -# Options: "tunnistamo", "tunnistus" -VITE_OIDC_PROVIDER=tunnistamo diff --git a/README.md b/README.md index a7f22fac..a724d4c8 100644 --- a/README.md +++ b/README.md @@ -34,10 +34,6 @@ You can log into the container to execute some commands like so: docker exec -it mvj-ui bash ``` -If you want to set up full integration with mvj backend and tunnistamo, check -[here](https://github.com/City-of-Helsinki/mvj#connecting-to-tunnistamo) -for the guidance. - ## Usage w/o Docker diff --git a/src/auth/constants.ts b/src/auth/constants.ts index 019e05d3..18e90579 100644 --- a/src/auth/constants.ts +++ b/src/auth/constants.ts @@ -1,19 +1,5 @@ import type { LoginProviderProps } from 'hds-react'; -type OidcProviderName = 'tunnistamo' | 'tunnistus'; - -// Tunnistamo SSO (legacy) -const loginProviderTunnistamoProperties: LoginProviderProps = { - userManagerSettings: { - authority: import.meta.env.VITE_OPENID_CONNECT_AUTHORITY_URL || 'https://api.hel.fi/sso/openid/', - client_id: import.meta.env.VITE_OPENID_CONNECT_CLIENT_ID || '', - scope: import.meta.env.VITE_OPENID_CONNECT_SCOPE || 'openid profile https://api.hel.fi/auth/mvj', - redirect_uri: `${location.origin}/callback`, - }, - apiTokensClientSettings: { url: import.meta.env.VITE_OPENID_CONNECT_API_TOKEN_URL }, - sessionPollerSettings: { pollIntervalInMs: 300000 } // 300000ms = 5min -}; - // Tunnistus SSO const loginProviderTunnistusProperties: LoginProviderProps = { userManagerSettings: { @@ -33,9 +19,6 @@ const loginProviderTunnistusProperties: LoginProviderProps = { sessionPollerSettings: { pollIntervalInMs: 300000 } // 300000ms = 5min }; -export const oidcProviderName: OidcProviderName = import.meta.env.VITE_OIDC_PROVIDER || 'tunnistus'; -// By default use Tunnistus SSO -export const loginProviderProperties = oidcProviderName === 'tunnistamo' ? loginProviderTunnistamoProperties : loginProviderTunnistusProperties; -const tunnistamoApiTokenKeyName: string = import.meta.env.VITE_OPENID_CONNECT_API_TOKEN_KEY || 'https://api.hel.fi/auth/mvj'; +export const loginProviderProperties = loginProviderTunnistusProperties; const tunnistusApiTokenKeyName: string = import.meta.env.VITE_TUNNISTUS_OIDC_API_AUDIENCE || 'mvj-api'; -export const apiTokenKeyName = oidcProviderName === 'tunnistamo' ? tunnistamoApiTokenKeyName : tunnistusApiTokenKeyName; \ No newline at end of file +export const apiTokenKeyName = tunnistusApiTokenKeyName; \ No newline at end of file