f4d1a04303
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
24 lines
877 B
TypeScript
24 lines
877 B
TypeScript
import { IAuthconfigFactory, AppConfig } from '@farmmaps/common';
|
|
import { AuthConfig } from 'angular-oauth2-oidc';
|
|
import { Injectable } from "@angular/core";
|
|
|
|
@Injectable()
|
|
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 = "profile api offline_access";
|
|
authConfig.disableAtHashCheck = true;
|
|
authConfig.responseType = "code";
|
|
authConfig.requireHttps = appConfig.getConfig("requireHttps");
|
|
return authConfig;
|
|
}
|
|
}
|