Skip to content

Commit

Permalink
remove mentions of tunnistamo sso
Browse files Browse the repository at this point in the history
  • Loading branch information
henrinie-nc committed Nov 11, 2024
1 parent adceda1 commit 4074030
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 32 deletions.
9 changes: 0 additions & 9 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
21 changes: 2 additions & 19 deletions src/auth/constants.ts
Original file line number Diff line number Diff line change
@@ -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: {
Expand All @@ -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;
export const apiTokenKeyName = tunnistusApiTokenKeyName;

0 comments on commit 4074030

Please sign in to comment.