Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.oidcConfigService.onConfigurationLoaded.subscribe(() => {
const openIDImplicitFlowConfiguration = new OpenIDImplicitFlowConfiguration();
openIDImplicitFlowConfiguration.stsServer = 'https://localhost:44319';
openIDImplicitFlowConfiguration.redirect_url = 'https://localhost:44308';
// The Client MUST validate that the aud (audience) Claim contains its client_id value registered at the Issuer identified by the iss (issuer) Claim as an audience.
// The ID Token MUST be rejected if the ID Token does not list the Client as a valid audience, or if it contains additional audiences not trusted by the Client.
openIDImplicitFlowConfiguration.client_id = 'angular4client';
openIDImplicitFlowConfiguration.response_type = 'id_token token';
openIDImplicitFlowConfiguration.scope = 'dataEventRecords openid';
openIDImplicitFlowConfiguration.post_logout_redirect_uri = 'https://localhost:44308/Unauthorized';
openIDImplicitFlowConfiguration.start_checksession = false;
openIDImplicitFlowConfiguration.silent_renew = true;
openIDImplicitFlowConfiguration.post_login_route = '/dataeventrecords';
// HTTP 403
openIDImplicitFlowConfiguration.forbidden_route = '/Forbidden';
// HTTP 401
openIDImplicitFlowConfiguration.unauthorized_route = '/Unauthorized';
this.configClient().subscribe((config: any) => {
this.clientConfiguration = config;
let openIDImplicitFlowConfiguration = new OpenIDImplicitFlowConfiguration();
openIDImplicitFlowConfiguration.stsServer = this.clientConfiguration.stsServer;
openIDImplicitFlowConfiguration.redirect_url = this.clientConfiguration.redirect_url;
// The Client MUST validate that the aud (audience) Claim contains its client_id value registered at the Issuer identified by the iss (issuer) Claim as an audience.
// The ID Token MUST be rejected if the ID Token does not list the Client as a valid audience, or if it contains additional audiences not trusted by the Client.
openIDImplicitFlowConfiguration.client_id = this.clientConfiguration.client_id;
openIDImplicitFlowConfiguration.response_type = this.clientConfiguration.response_type;
openIDImplicitFlowConfiguration.scope = this.clientConfiguration.scope;
openIDImplicitFlowConfiguration.post_logout_redirect_uri = this.clientConfiguration.post_logout_redirect_uri;
openIDImplicitFlowConfiguration.start_checksession = this.clientConfiguration.start_checksession;
openIDImplicitFlowConfiguration.silent_renew = this.clientConfiguration.silent_renew;
openIDImplicitFlowConfiguration.post_login_route = this.clientConfiguration.startup_route;
// HTTP 403
openIDImplicitFlowConfiguration.forbidden_route = this.clientConfiguration.forbidden_route;
// HTTP 401
openIDImplicitFlowConfiguration.unauthorized_route = this.clientConfiguration.unauthorized_route;
constructor(public oidcSecurityService: OidcSecurityService) {
const openIDImplicitFlowConfiguration = new OpenIDImplicitFlowConfiguration();
openIDImplicitFlowConfiguration.stsServer = 'https://localhost:44318';
openIDImplicitFlowConfiguration.redirect_url = 'https://localhost:44395';
// The Client MUST validate that the aud (audience) Claim contains its client_id value registered at the Issuer
// identified by the iss (issuer) Claim as an audience.
// The ID Token MUST be rejected if the ID Token does not list the Client as a valid audience,
// or if it contains additional audiences not trusted by the Client.
openIDImplicitFlowConfiguration.client_id = 'ClientTwo';
openIDImplicitFlowConfiguration.response_type = 'id_token token';
openIDImplicitFlowConfiguration.scope = 'dataEventRecords openid profile email';
openIDImplicitFlowConfiguration.post_logout_redirect_uri = 'https://localhost:44395/unauthorized';
openIDImplicitFlowConfiguration.start_checksession = false;
openIDImplicitFlowConfiguration.silent_renew = false;
openIDImplicitFlowConfiguration.post_login_route = '/home';
// HTTP 403
openIDImplicitFlowConfiguration.forbidden_route = '/unauthorized';
constructor(
private oidcSecurityService: OidcSecurityService,
private http: HttpClient,
@Inject('BASE_URL') private originUrl: string,
@Inject('AUTH_URL') private authUrl: string,
) {
const openIdImplicitFlowConfiguration = new OpenIDImplicitFlowConfiguration();
openIdImplicitFlowConfiguration.stsServer = authUrl,
openIdImplicitFlowConfiguration.redirect_url = originUrl + 'callback',
openIdImplicitFlowConfiguration.client_id = 'spaClient';
openIdImplicitFlowConfiguration.response_type = 'id_token token';
openIdImplicitFlowConfiguration.scope = 'openid profile resourceApi';
openIdImplicitFlowConfiguration.post_logout_redirect_uri = originUrl;
openIdImplicitFlowConfiguration.forbidden_route = '/forbidden';
openIdImplicitFlowConfiguration.unauthorized_route = '/unauthorized';
openIdImplicitFlowConfiguration.auto_userinfo = true;
openIdImplicitFlowConfiguration.log_console_warning_active = true;
openIdImplicitFlowConfiguration.log_console_debug_active = true;
openIdImplicitFlowConfiguration.max_id_token_iat_offset_allowed_in_seconds = 10;
const authWellKnownEndpoints = new AuthWellKnownEndpoints();
authWellKnownEndpoints.issuer = authUrl;
constructor(public oidcSecurityService: OidcSecurityService,
private http: HttpClient,
@Inject('ORIGIN_URL') originUrl: string,
configuration: ConfigurationService
) {
const openIdImplicitFlowConfiguration = new OpenIDImplicitFlowConfiguration();
openIdImplicitFlowConfiguration.stsServer = configuration.identityServerAddress;
openIdImplicitFlowConfiguration.redirect_url = originUrl;
openIdImplicitFlowConfiguration.client_id = 'ng';
openIdImplicitFlowConfiguration.response_type = 'id_token token';
openIdImplicitFlowConfiguration.scope = 'openid profile apiApp';
openIdImplicitFlowConfiguration.post_logout_redirect_uri = originUrl + 'home';
openIdImplicitFlowConfiguration.forbidden_route = '/forbidden';
openIdImplicitFlowConfiguration.unauthorized_route = '/unauthorized';
openIdImplicitFlowConfiguration.auto_userinfo = true;
openIdImplicitFlowConfiguration.log_console_warning_active = true;
openIdImplicitFlowConfiguration.log_console_debug_active = false;
openIdImplicitFlowConfiguration.max_id_token_iat_offset_allowed_in_seconds = 10;
this.oidcSecurityService.setupModule(openIdImplicitFlowConfiguration);
if (this.oidcSecurityService.moduleSetup) {
this.oidcConfigService.onConfigurationLoaded.subscribe(() => {
const config = new OpenIDImplicitFlowConfiguration();
config.stsServer = 'https://offeringsolutions-sts.azurewebsites.net';
config.redirect_url = 'https://localhost:4200';
config.client_id = 'angularClient';
config.scope = 'openid profile email';
config.response_type = 'code';
config.silent_renew = true;
config.silent_renew_url = 'https://localhost:4200/silent-renew.html';
config.log_console_debug_active = true;
//config.start_checksession = true;
//config.post_login_route = '/home';
//config.forbidden_route = '/home';
//config.unauthorized_route = '/home';
//config.max_id_token_iat_offset_allowed_in_seconds = 5;
//config.history_cleanup_off = true;
this.oidcConfigService.onConfigurationLoaded.subscribe(() => {
const openIDImplicitFlowConfiguration = new OpenIDImplicitFlowConfiguration();
openIDImplicitFlowConfiguration.stsServer = 'https://login.microsoftonline.com/tfp/fabrikamb2c.onmicrosoft.com/b2c_1_susi/oauth2/v2.0/';
openIDImplicitFlowConfiguration.redirect_url = 'http://localhost:65328/redirect.html';
openIDImplicitFlowConfiguration.client_id = 'e760cab2-b9a1-4c0d-86fb-ff7084abd902';
openIDImplicitFlowConfiguration.response_type = 'id_token token';
openIDImplicitFlowConfiguration.scope = 'openid https://fabrikamb2c.onmicrosoft.com/demoapi/demo.read';
openIDImplicitFlowConfiguration.post_logout_redirect_uri = 'http://localhost:65328';
openIDImplicitFlowConfiguration.post_login_route = '/home';
openIDImplicitFlowConfiguration.forbidden_route = '/home';
openIDImplicitFlowConfiguration.unauthorized_route = '/home';
openIDImplicitFlowConfiguration.auto_userinfo = false;
openIDImplicitFlowConfiguration.log_console_warning_active = true;
openIDImplicitFlowConfiguration.log_console_debug_active = !environment.production;
openIDImplicitFlowConfiguration.max_id_token_iat_offset_allowed_in_seconds = 30;
const authWellKnownEndpoints = new AuthWellKnownEndpoints();
authWellKnownEndpoints.setWellKnownEndpoints(this.oidcConfigService.wellKnownEndpoints);