How to use the angular-auth-oidc-client.AuthModule.forRoot function in angular-auth-oidc-client

To help you get started, we’ve selected a few angular-auth-oidc-client examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github damienbod / AspNetCoreOpeniddictAngularImplicitFlow / AngularOpenidImplicitFlowClient / angularApp / app / app.module.ts View on Github external
} 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
        },
github IgniteUI / igniteui-cli / templates / angular / igx-ts / projects / side-nav-auth / files / src / app / authentication / authentication.module.ts View on Github external
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,
github elanderson / Angular-Core-IdentityServer / ClientApp / ClientApp / src / app / app.module.ts View on Github external
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,
github vietnam-devs / crmcore / src / hosts / CRMCore.ClientApp.Angular / src / app / app.module.ts View on Github external
];

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 {
github damienbod / AspNetCoreIdentityServer4Persistence / ClientTwo / angularApp / app / app.module.ts View on Github external
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],
})
github HWouters / ad-b2c-oidc-angular / src / app / app.module.ts View on Github external
{ 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(
github damienbod / AspNetCoreID4External / src / AngularCliClient / src / app / app.module.ts View on Github external
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,
      }
  ],
github lydemann / oidc-angular-identityserver / Solution 6 - OIDC and Angular client / ClientNgApp / ClientApp / src / app / core / core.module.ts View on Github external
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 { }
github damienbod / angular-auth-oidc-client / projects / sample-code-flow / src / app / app.module.ts View on Github external
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();
github lydemann / oidc-angular-identityserver / Solution 6 - OIDC and Angular client / ClientApp / ClientApp / app / app.shared.module.ts View on Github external
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
    ]