Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
} from 'angular-auth-oidc-client';
export function loadConfig(oidcConfigService: OidcConfigService) {
console.log('APP_INITIALIZER STARTING');
return () => oidcConfigService.load_using_stsServer('https://localhost:44319');
}
@NgModule({
imports: [
BrowserModule,
FormsModule,
routing,
HttpModule,
JsonpModule,
DataEventRecordsModule,
AuthModule.forRoot(),
],
declarations: [
AppComponent,
ForbiddenComponent,
HomeComponent,
UnauthorizedComponent
],
providers: [
OidcSecurityService,
OidcConfigService,
{
provide: APP_INITIALIZER,
useFactory: loadConfig,
deps: [OidcConfigService],
multi: true
},
import { LoginDialogComponent } from './login-dialog/login-dialog.component';
import { AuthenticationRoutingModule } from './authentication-routing.module';
import { AuthModule, OidcConfigService, } from 'angular-auth-oidc-client';
import {
IgxDialogModule, IgxIconModule,
IgxInputGroupModule, IgxButtonModule,
IgxAvatarModule, IgxToggleModule, IgxDropDownModule, IgxRippleModule
} from 'igniteui-angular';
@NgModule({
imports: [
CommonModule,
HttpClientModule,
ReactiveFormsModule,
AuthModule.forRoot(),
AuthenticationRoutingModule,
IgxToggleModule,
IgxRippleModule,
IgxDialogModule,
IgxInputGroupModule,
IgxIconModule,
IgxAvatarModule,
IgxButtonModule,
IgxDropDownModule
],
declarations: [
LoginBarComponent,
LoginComponent,
RedirectComponent,
RegisterComponent,
LoginDialogComponent,
return appConfig.loadConfig();
};
};
@NgModule({
declarations: [
AppComponent,
NavMenuComponent,
HomeComponent,
CounterComponent,
FetchDataComponent,
UnauthorizedComponent
],
imports: [
BrowserModule.withServerTransition({ appId: 'ng-cli-universal' }),
AuthModule.forRoot(),
HttpClientModule,
FormsModule,
RouterModule.forRoot([
{ path: '', component: HomeComponent, pathMatch: 'full' },
{ path: 'counter', component: CounterComponent },
{ path: 'fetch-data', component: FetchDataComponent },
{ path: 'unauthorized', component: UnauthorizedComponent }
])
],
providers: [
{ provide: 'ORIGIN_URL', useFactory: getBaseUrl },
AuthService,
OidcSecurityService,
ConfigurationService,
{
provide: APP_INITIALIZER,
];
import { AuthInterceptor } from './interceptors/Auth.interceptor';
@NgModule({
declarations: [
AppComponent,
...APP_CONTAINERS,
...APP_COMPONENTS,
...APP_DIRECTIVES
],
imports: [
BrowserModule,
AppRoutingModule,
HttpClientModule,
AuthModule.forRoot()
],
providers: [
{
provide: LocationStrategy,
useClass: HashLocationStrategy
},
{
provide: HTTP_INTERCEPTORS,
useClass: AuthInterceptor,
multi: true
},
OidcSecurityService
],
bootstrap: [AppComponent]
})
export class AppModule {
import {
MatToolbarModule,
MatButtonModule,
} from '@angular/material';
import { CommonModule } from '@angular/common';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
@NgModule({
imports: [
BrowserModule,
BrowserAnimationsModule,
CommonModule,
FormsModule,
routing,
HttpClientModule,
AuthModule.forRoot(),
FlexLayoutModule,
MatToolbarModule,
MatButtonModule
],
declarations: [
AppComponent,
HomeComponent,
UnauthorizedComponent
],
providers: [
OidcSecurityService,
Configuration
],
bootstrap: [AppComponent],
})
{ path: '', redirectTo: 'home', pathMatch: 'full' },
{ path: 'home', component: HomeComponent },
{ path: 'redirect.html', component: RedirectComponent }
];
@NgModule({
declarations: [
AppComponent,
RedirectComponent,
HomeComponent
],
imports: [
BrowserModule,
FormsModule,
HttpClientModule,
AuthModule.forRoot(),
RouterModule.forRoot(appRoutes),
],
providers: [
OidcConfigService,
{
provide: APP_INITIALIZER,
useFactory: loadConfig,
deps: [OidcConfigService],
multi: true
}
],
bootstrap: [AppComponent]
})
export class AppModule {
constructor(
responseType: 'code',
silentRenew: true,
renewTimeBeforeTokenExpiresInSeconds: 10,
useRefreshToken: true,
logLevel: LogLevel.Debug,
});
}
@NgModule({
imports: [
BrowserModule,
FormsModule,
routing,
HttpClientModule,
DataEventRecordsModule,
AuthModule.forRoot(),
],
declarations: [
AppComponent,
ForbiddenComponent,
HomeComponent,
UnauthorizedComponent
],
providers: [
OidcConfigService,
{
provide: APP_INITIALIZER,
useFactory: configureAuth,
deps: [OidcConfigService, HttpClient],
multi: true,
}
],
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { AuthService } from './auth/auth.service';
import { AuthModule, OidcSecurityService } from 'angular-auth-oidc-client';
@NgModule({
imports: [
CommonModule,
AuthModule.forRoot()
],
declarations: [],
providers: [
AuthService,
OidcSecurityService,
]
})
export class CoreModule { }
export function loadConfig(oidcConfigService: OidcConfigService) {
return () => oidcConfigService.load_using_stsServer('https://offeringsolutions-sts.azurewebsites.net');
}
@NgModule({
declarations: [AppComponent],
imports: [
BrowserModule,
HttpClientModule,
RouterModule.forRoot([
{ path: '', component: AppComponent },
{ path: 'home', component: AppComponent },
{ path: 'forbidden', component: AppComponent },
{ path: 'unauthorized', component: AppComponent },
]),
AuthModule.forRoot(),
],
providers: [
OidcConfigService,
{
provide: APP_INITIALIZER,
useFactory: loadConfig,
deps: [OidcConfigService],
multi: true,
},
],
bootstrap: [AppComponent],
})
export class AppModule {
constructor(private oidcSecurityService: OidcSecurityService, private oidcConfigService: OidcConfigService) {
this.oidcConfigService.onConfigurationLoaded.subscribe(() => {
const config = new OpenIDImplicitFlowConfiguration();
import { CounterComponent } from './components/counter/counter.component';
import { UnauthorizedComponent } from './components/unauthorized/unauthorized.component';
import { AuthModule, OidcSecurityService } from 'angular-auth-oidc-client';
import { AuthService } from './components/core/auth.service';
@NgModule({
declarations: [
AppComponent,
NavMenuComponent,
CounterComponent,
FetchDataComponent,
UnauthorizedComponent,
HomeComponent
],
imports: [
AuthModule.forRoot(),
CommonModule,
HttpClientModule,
FormsModule,
RouterModule.forRoot([
{ path: '', redirectTo: 'home', pathMatch: 'full' },
{ path: 'home', component: HomeComponent },
{ path: 'counter', component: CounterComponent },
{ path: 'fetch-data', component: FetchDataComponent },
{ path: 'unauthorized', component: UnauthorizedComponent },
{ path: '**', redirectTo: 'home' }
])
],
providers: [
AuthService,
OidcSecurityService
]