refactor: read auth provider info from app config

This commit is contained in:
Jovan Krunić
2022-02-07 16:46:29 +00:00
committed by Rainer Killinger
parent a1592f84cc
commit fb7b3fd1d2
19 changed files with 216 additions and 287 deletions

View File

@@ -16,65 +16,14 @@
// The build system defaults to the dev environment which uses `environment.ts`, but if you do
// `ng build --env=prod` then `environment.prod.ts` will be used instead.
// The list of which env maps to which file can be found in `.angular-cli.json`.
import {AuthorizationServiceConfigurationJson} from '@openid/appauth';
import {IAuthConfig} from 'ionic-appauth';
// import config from 'capacitor.config';
const appDomain = 'mobile.app.uni-frankfurt.de';
export const environment = {
backend_url: 'https://mobile.server.uni-frankfurt.de',
daia_url: 'https://daia.hebis.de/DAIA2/UB_Frankfurt',
appDomain: 'mobile.app.uni-frankfurt.de',
app_host: 'mobile.app.uni-frankfurt.de',
backend_version: '2.0.0',
use_fake_backend: true,
production: false,
oauth2: {
client: {
his: {
client_id: '1cac3f99-33fa-4234-8438-979f07e0cdab',
client_secret: 'CLIENT_SECRET',
server_host: 'https://cas.rz.uni-frankfurt.de/cas/oauth2.0',
redirect_url: `https://${appDomain}/auth/callback`,
scopes: '',
pkce: true,
} as IAuthConfig,
paia: {
client_id: '',
client_secret: '',
server_host:
'https://hds.hebis.de/Shibboleth.sso/UBFFM?target=https://hds.hebis.de/ubffm/paia_login_stub.php',
// TODO: Use Custom URL Scheme (ideally bundle ID from capacitor.config)
redirect_url: `https://${appDomain}/auth/paia/callback`,
scopes: '',
pkce: true,
} as IAuthConfig,
},
service: {
his: {
authorization_endpoint:
'https://cas.rz.uni-frankfurt.de/cas/oauth2.0/authorize',
token_endpoint:
'https://cas.rz.uni-frankfurt.de/cas/oauth2.0/accessToken',
userinfo_endpoint:
'https://cas.rz.uni-frankfurt.de/cas/oauth2.0/profile',
} as AuthorizationServiceConfigurationJson,
paia: {
authorization_endpoint:
'https://hds.hebis.de/Shibboleth.sso/UBFFM?target=https://hds.hebis.de/ubffm/paia_login_stub.php',
token_endpoint: 'https://hds.hebis.de:8443/auth/login',
userinfo_endpoint: 'https://hds.hebis.de:8443/core',
} as AuthorizationServiceConfigurationJson,
},
endpointMappings: {
userinfo: {
id: 'employeeNumber',
given_name: 'givenName',
family_name: 'sn',
email: 'mailPrimaryAddress',
},
},
},
};
/*

View File

@@ -16,65 +16,14 @@
// The build system defaults to the dev environment which uses `environment.ts`, but if you do
// `ng build --env=prod` then `environment.prod.ts` will be used instead.
// The list of which env maps to which file can be found in `.angular-cli.json`.
import {AuthorizationServiceConfigurationJson} from '@openid/appauth';
import {IAuthConfig} from 'ionic-appauth';
// import config from 'capacitor.config';
const appDomain = 'mobile.app.uni-frankfurt.de';
export const environment = {
backend_url: 'https://mobile.server.uni-frankfurt.de',
daia_url: 'https://daia.hebis.de/DAIA2/UB_Frankfurt',
appDomain: 'mobile.app.uni-frankfurt.de',
app_host: 'mobile.app.uni-frankfurt.de',
backend_version: '2.0.0',
use_fake_backend: false,
production: false,
oauth2: {
client: {
his: {
client_id: '1cac3f99-33fa-4234-8438-979f07e0cdab',
client_secret: 'CLIENT_SECRET',
server_host: 'https://cas.rz.uni-frankfurt.de/cas/oauth2.0',
redirect_url: `https://${appDomain}/auth/callback`,
scopes: '',
pkce: true,
} as IAuthConfig,
paia: {
client_id: '',
client_secret: '',
server_host:
'https://hds.hebis.de/Shibboleth.sso/UBFFM?target=https://hds.hebis.de/ubffm/paia_login_stub.php',
// TODO: Use Custom URL Scheme (ideally bundle ID from capacitor.config)
redirect_url: `https://${appDomain}/auth/paia/callback`,
scopes: '',
pkce: true,
} as IAuthConfig,
},
service: {
his: {
authorization_endpoint:
'https://cas.rz.uni-frankfurt.de/cas/oauth2.0/authorize',
token_endpoint:
'https://cas.rz.uni-frankfurt.de/cas/oauth2.0/accessToken',
userinfo_endpoint:
'https://cas.rz.uni-frankfurt.de/cas/oauth2.0/profile',
} as AuthorizationServiceConfigurationJson,
paia: {
authorization_endpoint:
'https://hds.hebis.de/Shibboleth.sso/UBFFM?target=https://hds.hebis.de/ubffm/paia_login_stub.php',
token_endpoint: 'https://hds.hebis.de:8443/auth/login',
userinfo_endpoint: 'https://hds.hebis.de:8443/core',
} as AuthorizationServiceConfigurationJson,
},
endpointMappings: {
userinfo: {
id: 'employeeNumber',
given_name: 'givenName',
family_name: 'sn',
email: 'mailPrimaryAddress',
},
},
},
production: true,
};
/*

View File

@@ -16,65 +16,14 @@
// The build system defaults to the dev environment which uses `environment.ts`, but if you do
// `ng build --env=prod` then `environment.prod.ts` will be used instead.
// The list of which env maps to which file can be found in `.angular-cli.json`.
import {AuthorizationServiceConfigurationJson} from '@openid/appauth';
import {IAuthConfig} from 'ionic-appauth';
// import config from 'capacitor.config';
const appDomain = 'mobile.app.uni-frankfurt.de';
export const environment = {
backend_url: 'https://mobile.server.uni-frankfurt.de',
daia_url: 'https://daia.hebis.de/DAIA2/UB_Frankfurt',
appDomain: 'mobile.app.uni-frankfurt.de',
app_host: 'mobile.app.uni-frankfurt.de',
backend_version: '2.0.0',
use_fake_backend: false,
production: false,
oauth2: {
client: {
his: {
client_id: '1cac3f99-33fa-4234-8438-979f07e0cdab',
client_secret: '',
server_host: 'https://cas.rz.uni-frankfurt.de/cas/oauth2.0',
redirect_url: `https://${appDomain}/auth/callback`,
scopes: '',
pkce: true,
} as IAuthConfig,
paia: {
client_id: '',
client_secret: '',
server_host:
'https://hds.hebis.de/Shibboleth.sso/UBFFM?target=https://hds.hebis.de/ubffm/paia_login_stub.php',
// TODO: Use Custom URL Scheme (ideally bundle ID from capacitor.config)
redirect_url: `https://${appDomain}/auth/paia/callback`,
scopes: '',
pkce: true,
} as IAuthConfig,
},
service: {
his: {
authorization_endpoint:
'https://cas.rz.uni-frankfurt.de/cas/oauth2.0/authorize',
token_endpoint:
'https://cas.rz.uni-frankfurt.de/cas/oauth2.0/accessToken',
userinfo_endpoint:
'https://cas.rz.uni-frankfurt.de/cas/oauth2.0/profile',
} as AuthorizationServiceConfigurationJson,
paia: {
authorization_endpoint:
'https://hds.hebis.de/Shibboleth.sso/UBFFM?target=https://hds.hebis.de/ubffm/paia_login_stub.php',
token_endpoint: 'https://hds.hebis.de:8443/auth/login',
userinfo_endpoint: 'https://hds.hebis.de:8443/core',
} as AuthorizationServiceConfigurationJson,
},
endpointMappings: {
userinfo: {
id: 'employeeNumber',
given_name: 'givenName',
family_name: 'sn',
email: 'mailPrimaryAddress',
},
},
},
};
/*