Add id4AuthconfigFactory
This commit is contained in:
parent
937dbe9b43
commit
252ce855c9
@ -21,6 +21,7 @@ import { MenuComponent } from './menu/menu.component';
|
|||||||
import {RegisterDeviceComponent} from './registerdevice/registerdevice.component';
|
import {RegisterDeviceComponent} from './registerdevice/registerdevice.component';
|
||||||
import { SecureOAuthStorage} from '@farmmaps/common';
|
import { SecureOAuthStorage} from '@farmmaps/common';
|
||||||
import { OAuthStorage } from 'angular-oauth2-oidc';
|
import { OAuthStorage } from 'angular-oauth2-oidc';
|
||||||
|
import {Id4AuthconfigFactory} from './id4AuthconfigFactory';
|
||||||
|
|
||||||
export const BOOTSTRAP_EFFECTS = new InjectionToken('Bootstrap Effects');
|
export const BOOTSTRAP_EFFECTS = new InjectionToken('Bootstrap Effects');
|
||||||
|
|
||||||
|
21
src/app/id4AuthconfigFactory.ts
Normal file
21
src/app/id4AuthconfigFactory.ts
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
import { IAuthconfigFactory, AppConfig } from '@farmmaps/common';
|
||||||
|
import { AuthConfig } from 'angular-oauth2-oidc';
|
||||||
|
|
||||||
|
export class Id4AuthconfigFactory implements IAuthconfigFactory {
|
||||||
|
constructor() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
getAuthConfig(appConfig: AppConfig): AuthConfig {
|
||||||
|
let authConfig: AuthConfig = new AuthConfig();
|
||||||
|
authConfig.issuer = appConfig.getConfig("issuer");
|
||||||
|
authConfig.redirectUri = window.location.origin + "/cb";
|
||||||
|
authConfig.clientId = appConfig.getConfig("clientId");
|
||||||
|
authConfig.customQueryParams = { audience: appConfig.getConfig("audience") };
|
||||||
|
authConfig.scope = "api offline_access";
|
||||||
|
authConfig.disableAtHashCheck = true;
|
||||||
|
authConfig.responseType = "code";
|
||||||
|
authConfig.requireHttps = appConfig.getConfig("requireHttps");
|
||||||
|
return authConfig;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user