How to use the angular-oauth2-oidc.OAuthModule.forRoot function in angular-oauth2-oidc

To help you get started, we’ve selected a few angular-oauth2-oidc 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 fabric8-ui / fabric8-ui / packages / fabric8-ui / src / a-runtime-console / kubernetes / service / kubernetes.restangular.ts View on Github external
// console.log("===== setting kubernetes token: " + (token ? "token" : "no token") + " for " + url);
        headers['Authorization'] = `Bearer ${onLogin.token}`;
        return {
          params,
          headers,
          element,
        };
      },
    );
  });
  return config;
}

@NgModule({
  imports: [OAuthModule.forRoot()],
  providers: [
    {
      provide: KUBERNETES_RESTANGULAR,
      useFactory: KubernetesRestangularFactory,
      deps: [Restangular, OAuthService, OnLogin],
    },
  ],
})
export class KubernetesRestangularModule {}
github xmlking / ngx-starter-kit / libs / auth / src / lib / auth.module.ts View on Github external
MatInputModule,
  MatFormFieldModule,
  MatTooltipModule,
  MatToolbarModule,
];

@NgModule({
  imports: [
    CommonModule,
    NgxsModule.forFeature([AuthState]),
    RouterModule,
    [...matModules],
    FlexLayoutModule,
    ReactiveFormsModule,
    FontAwesomeModule,
    OAuthModule.forRoot({
      resourceServer: {
        allowedUrls: [environment.API_BASE_URL, environment.DOCS_BASE_URL],
        sendAccessToken: true,
      },
    }),
  ],
  declarations: [LoginComponent],
  entryComponents: [LoginComponent],
  providers: [
    ROPCService,
    AuthService,
    AuthGuard,
    { provide: ValidationHandler, useClass: JwksValidationHandler },
    // NOTE: for CodeFlow use NullValidationHandler
    // { provide: ValidationHandler, useClass: NullValidationHandler },
  ],
github caos / zitadel / console / src / app / app.module.ts View on Github external
scope: 'openid profile email', // offline_access
  responseType: 'code',
  oidc: true,
};

@NgModule({
  declarations: [
    AppComponent,
    SignedoutComponent,
  ],
  imports: [
    AppRoutingModule,
    CommonModule,
    BrowserModule,
    OverlayModule,
    OAuthModule.forRoot({
      resourceServer: {
        allowedUrls: ['https://test.api.zitadel.caos.ch/caos.zitadel.auth.api.v1.AuthService', 'https://test.api.zitadel.caos.ch/oauth/v2/userinfo', 'https://test.api.zitadel.caos.ch/caos.zitadel.management.api.v1.ManagementService/', 'https://preview.api.zitadel.caos.ch'],
        sendAccessToken: true,
      },
    }),
    TranslateModule.forRoot({
      loader: {
        provide: TranslateLoader,
        useClass: WebpackTranslateLoader,
      },
    }),
    MatNativeDateModule,
    QuicklinkModule,
    AccountsCardModule,
    HasRoleModule,
    BrowserAnimationsModule,
github GoogleCloudPlatform / professional-services / tools / bq-visualizer / src / app / app.module.ts View on Github external
MatButtonModule,
    MatCheckboxModule,
    MatSelectModule,
    MatCardModule,
    MatExpansionModule,
    MatInputModule,
    MatPaginatorModule,
    MatTableModule,
    MatGridListModule,
    MatMenuModule,
    MatIconModule,
    BrowserModule,
    // note to self: import HttpClientModule after BrowserModule, otherwise
    // there is trouble.
    HttpClientModule,
    OAuthModule.forRoot(),
  ],
  providers: [
    {provide: ErrorHandler, useClass: SentryErrorHandler},
  ],
  bootstrap: [AppComponent]
})
export class AppModule {
}
github manfredsteyer / angular-oauth2-oidc / sample / src / app / app.module.ts View on Github external
import {AppRouterModule} from './app.routes';
import {BASE_URL} from './app.tokens';
import {FlightHistoryComponent} from './flight-history/flight-history.component';
import {HomeComponent} from './home/home.component';
import {PasswordFlowLoginComponent} from './password-flow-login/password-flow-login.component';
import {SharedModule} from './shared/shared.module';

@NgModule({
    imports: [
        BrowserModule,
        FormsModule,
        ReactiveFormsModule,
        SharedModule.forRoot(),
        AppRouterModule,
        HttpClientModule,
        OAuthModule.forRoot(
            {
            resourceServer: {
                allowedUrls: ['http://www.angular.at/api'],
                sendAccessToken: true
            }
        }
    )
    ],
    declarations: [
        AppComponent,
        HomeComponent,
        FlightHistoryComponent,
        PasswordFlowLoginComponent
    ],
    providers: [
        // {provide: AuthConfig, useValue: authConfig },
github nokia / CloudFlow / src / app / app.module.ts View on Github external
@NgModule({
    declarations: [
        AppComponent,
        AboutComponent,
        HomeComponent,
        SearchComponent,
    ],
    imports: [
        BrowserModule,
        AppRoutingModule,
        NgbModule.forRoot(),
        HttpClientModule,
        BrowserAnimationsModule,
        OAuthModule.forRoot(),
        FormsModule,
    ],
    providers: [
        MistralService,
        {
            provide: HTTP_INTERCEPTORS,
            useClass: AuthIntercept,
            multi: true
        },
        {
            provide: HTTP_INTERCEPTORS,
            useClass: UnauthorizedIntercept,
            multi: true
        },
        {
            provide: HTTP_INTERCEPTORS,
github robisim74 / AngularSPAWebAPI / ClientApp / src / app / app.module.ts View on Github external
import { HomeComponent } from './home/home.component';

import { OAuthModule } from 'angular-oauth2-oidc';
import { OAuthConfig } from './oauth.config';

export function initOAuth(oAuthConfig: OAuthConfig): Function {
    return () => oAuthConfig.load();
}

@NgModule({
    imports: [
        BrowserModule,
        AppRoutingModule,
        BrowserAnimationsModule,
        SharedModule,
        OAuthModule.forRoot()
    ],
    declarations: [
        AppComponent,
        HomeComponent
    ],
    exports: [
    ],
    providers: [
        Title,
        OAuthConfig,
        {
            provide: APP_INITIALIZER,
            useFactory: initOAuth,
            deps: [OAuthConfig],
            multi: true
        },
github eellak / gsoc2019-sphinx / angular-ui / src / app / app.module.ts View on Github external
LogInComponent,
    MenuComponent,
    LanguageAdaptationComponent,
    AcousticAdaptationComponent,
    DictationComponent,
    LoaderComponent,
    FooterComponent
  ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    RoutingModule,
    HttpClientModule,
    MatProgressSpinnerModule,
    CommonModule,
    OAuthModule.forRoot(),
    GoogleApiModule.forRoot({
      provide: NG_GAPI_CONFIG,
      useValue: gapiClientConfig
    }),
    FormsModule,
    Ng5SliderModule
  ],
  providers: [CookieService, LoaderService, { provide: HTTP_INTERCEPTORS, useClass: LoaderInterceptor, multi: true }, MyCookieService, AudioRecordingService],
  bootstrap: [AppComponent]
})
export class AppModule { }
github abpframework / abp / templates / module / angular / src / app / app.module.ts View on Github external
import { SharedModule } from './shared/shared.module';
import { MyProjectNameConfigModule } from '../../projects/my-project-name-config/src/public-api';

const LOGGERS = [NgxsLoggerPluginModule.forRoot({ disabled: false })];

@NgModule({
  declarations: [AppComponent],
  imports: [
    ThemeSharedModule.forRoot(),
    CoreModule.forRoot({
      environment,
      requirements: {
        layouts: LAYOUTS,
      },
    }),
    OAuthModule.forRoot(),
    NgxsModule.forRoot([]),
    AccountConfigModule.forRoot({ redirectUrl: '/' }),
    IdentityConfigModule,
    TenantManagementConfigModule,
    SettingManagementConfigModule,
    MyProjectNameConfigModule,
    BrowserModule,
    BrowserAnimationsModule,
    AppRoutingModule,
    SharedModule,

    ...(environment.production ? [] : LOGGERS),
  ],
  bootstrap: [AppComponent],
})
export class AppModule {}
github fabric8-ui / fabric8-ui / packages / fabric8-ui / src / a-runtime-console / kubernetes / kubernetes.store.module.ts View on Github external
import { BrowserModule } from "@angular/platform-browser";
*/

@NgModule({
  imports: [
    /*
    BrowserModule,
    RouterModule,
*/
    RestangularModule,
    KubernetesRestangularModule,
    LocalStorageModule.withConfig({
      prefix: 'fabric8',
      storageType: 'localStorage',
    }),
    OAuthModule.forRoot(),
  ],
  providers: [
    APIsStore,
    BuildService,
    BuildStore,
    BuildConfigService,
    BuildConfigStore,
    CompositeDeploymentStore,
    CompositeReplicaSetStore,
    ConfigMapService,
    ConfigMapStore,
    DevNamespaceScope,
    NamespaceScope,
    DeploymentConfigService,
    DeploymentConfigStore,
    DeploymentService,

angular-oauth2-oidc

Support for OAuth 2 and OpenId Connect (OIDC) in Angular. Already prepared for the upcoming OAuth 2.1.

MIT
Latest version published 8 months ago

Package Health Score

72 / 100
Full package analysis