How to use the @nebular/auth.NbAuthModule.forRoot function in @nebular/auth

To help you get started, we’ve selected a few @nebular/auth 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 akveo / nebular / 3.6.2 / assets / examples / azure / azure.module.ts View on Github external
} from '@nebular/theme';

import { NbAuthModule } from '@nebular/auth';

import { AzureLoginComponent } from './azure-login.component';
import { AzureCallbackComponent } from './azure-callback.component';
import { AuthAzureToken, AzureADB2CAuthStrategy } from './azure-adb2c-auth-strategy';
import { AzureRoutingModule } from './azure-routing.module';


@NgModule({
  imports: [
    CommonModule,
    FormsModule,
    HttpClientModule,
    NbAuthModule.forRoot({
      strategies: [
        AzureADB2CAuthStrategy.setup({
          name: 'azure',
          clientId: 'bde728e2-2809-4ff1-bc9c-7fcb23800ebe',
          clientSecret: '',
          authorize: {
            endpoint: 'https://login.microsoftonline.com/01513fd2-16a0-453b-9fa0-c9089bfa023e/oauth2/authorize',
            responseType: 'id_token',
            scope: 'openid',
            redirectUri: 'https://akveo.github.io/nebular/example/azure/callback',
            params: {
              p: 'b2c_1_nebular',
            },
          },
          token: {
            class: AuthAzureToken,
github akveo / nebular / 3.6.2 / assets / examples / auth / auth.module.ts View on Github external
]
    .some(url => req.url.includes(url));
}

@NgModule({
  imports: [
    CommonModule,
    FormsModule,
    HttpClientModule,
    AuthPlaygroundRoutingModule,

    NbCardModule,
    NbLayoutModule,
    NbListModule,

    NbAuthModule.forRoot({
      forms: {
        login: {
          strategy: 'password',
          redirectDelay: 1000,
          socialLinks: [
            {
              url: 'https://github.com/akveo',
              target: '_blank',
              title: 'GitHub',
            },
            {
              url: 'https://www.facebook.com/akveo',
              target: '_blank',
              icon: 'nb-home',
            },
            {
github akveo / nebular / assets / examples / smart-home / app.module.ts View on Github external
import { NbAuthModule, NbDummyAuthStrategy } from '@nebular/auth';
import { AppComponent } from './app.component';
import { AppRouting } from './app-routing.module';


@NgModule({
  imports: [
    CommonModule,
    HttpClientModule,
    NbLayoutModule,
    NbCardModule,
    NbButtonModule,
    AppRouting,

    NbAuthModule.forRoot({
      strategies: [
        NbDummyAuthStrategy.setup({
          name: 'email',

          alwaysFail: true,
          delay: 1000,
        }),
      ],
    }),
  ],
  declarations: [
    AppComponent,
  ],
})
export class AppModule {
}
github akveo / nebular / assets / examples / oauth2-password / oauth2-password.module.ts View on Github external
@NgModule({
  imports: [
    CommonModule,
    FormsModule,
    HttpClientModule,
    RouterModule,
    RouterModule.forChild([
      {
        path: '',
        component: NbOAuth2PasswordLoginComponent,
      },
    ]),

    NbAuthModule.forRoot({
      forms: {
        login: {
          redirectDelay: 3000,
          showMessages : {
            error: true,
            success: false,
          },
          strategy: 'password',
        },
      },
      strategies: [
         NbOAuth2AuthStrategy.setup({
          name: 'password',
          clientId: 'Aladdin',
          clientSecret: 'open sesame',
          clientAuthMethod: NbOAuth2ClientAuthMethod.BASIC,
github akveo / nebular / src / playground / with-layout / oauth2-password / oauth2-password.module.ts View on Github external
NbOAuth2AuthStrategy,
  NbOAuth2ClientAuthMethod,
  NbOAuth2GrantType,
} from '@nebular/auth';

import { OAuth2PasswordLoginComponent } from './oauth2-password-login.component';
import { Oauth2PasswordRoutingModule } from './oauth2-password-routing.module';


@NgModule({
  imports: [
    CommonModule,
    FormsModule,
    HttpClientModule,

    NbAuthModule.forRoot({
      forms: {
        login: {
          redirectDelay: 3000,
          showMessages : {
            error: true,
            success: false,
          },
          strategy: 'password',
        },
      },
      strategies: [
         NbOAuth2AuthStrategy.setup({
          name: 'password',
          clientId: 'Aladdin',
          clientSecret: 'open sesame',
          clientAuthMethod: NbOAuth2ClientAuthMethod.BASIC,
github akveo / nebular / packages-smoke / src / app / app.module.ts View on Github external
import { NbThemeModule } from '@nebular/theme';
import { NbAuthModule } from '@nebular/auth';
import { NbSecurityModule } from '@nebular/security';
import { NbMomentDateModule } from '@nebular/moment';
import { NbDateFnsDateModule } from '@nebular/date-fns';
import { NbEvaIconsModule } from '@nebular/eva-icons';

@NgModule({
  declarations: [
    AppComponent,
  ],
  imports: [
    BrowserModule,
    NbThemeModule.forRoot({ name: 'default' }),
    NbAuthModule.forRoot(),
    NbSecurityModule.forRoot(),
    NbMomentDateModule,
    NbDateFnsDateModule,
    NbEvaIconsModule,
  ],
  providers: [],
  bootstrap: [AppComponent],
})
export class AppModule {
}
github akveo / nebular / src / playground / without-layout / smart-home / app.module.ts View on Github external
import { NbAuthModule, NbDummyAuthStrategy } from '@nebular/auth';
import { AppComponent } from './app.component';
import { AppRouting } from './app-routing.module';


@NgModule({
  imports: [
    CommonModule,
    HttpClientModule,
    NbLayoutModule,
    NbCardModule,
    NbButtonModule,
    AppRouting,

    NbAuthModule.forRoot({
      strategies: [
        NbDummyAuthStrategy.setup({
          name: 'email',

          alwaysFail: true,
          delay: 1000,
        }),
      ],
    }),
  ],
  declarations: [
    AppComponent,
  ],
})
export class AppModule {
}
github akveo / nebular / src / playground / without-layout / auth / auth.module.ts View on Github external
]
    .some(url => req.url.includes(url));
}

@NgModule({
  imports: [
    CommonModule,
    FormsModule,
    HttpClientModule,
    AuthPlaygroundRoutingModule,

    NbCardModule,
    NbLayoutModule,
    NbListModule,

    NbAuthModule.forRoot({
      forms: {
        login: {
          strategy: 'password',
          redirectDelay: 1000,
          socialLinks: [
            {
              url: 'https://github.com/akveo',
              target: '_blank',
              title: 'GitHub',
            },
            {
              url: 'https://www.facebook.com/akveo',
              target: '_blank',
              icon: 'home-outline',
            },
            {
github akveo / nebular / assets / examples / oauth2 / oauth2.module.ts View on Github external
NbOAuth2AuthStrategy,
  NbOAuth2ResponseType,
} from '@nebular/auth';

import { OAuth2LoginComponent } from './oauth2-login.component';
import { OAuth2CallbackComponent } from './oauth2-callback.component';
import { Oauth2RoutingModule } from './oauth2-routing.module';


@NgModule({
  imports: [
    CommonModule,
    FormsModule,
    HttpClientModule,

    NbAuthModule.forRoot({
      strategies: [
        NbOAuth2AuthStrategy.setup({
          name: 'google',
          clientId: '806751403568-03376bvlin9n3rhid0cahus6ei3lc69q.apps.googleusercontent.com',
          clientSecret: '',
          authorize: {
            endpoint: 'https://accounts.google.com/o/oauth2/v2/auth',
            responseType: NbOAuth2ResponseType.TOKEN,
            scope: 'https://www.googleapis.com/auth/userinfo.profile',
            redirectUri: 'https://akveo.github.io/nebular/example/oauth2/callback',
          },

          redirect: {
            success: '/example/oauth2',
          },
        }),
github akveo / nebular / src / playground / without-layout / azure / azure.module.ts View on Github external
} from '@nebular/theme';

import { NbAuthModule } from '@nebular/auth';

import { AzureLoginComponent } from './azure-login.component';
import { AzureCallbackComponent } from './azure-callback.component';
import { AuthAzureToken, AzureADB2CAuthStrategy } from './azure-adb2c-auth-strategy';
import { AzureRoutingModule } from './azure-routing.module';


@NgModule({
  imports: [
    CommonModule,
    FormsModule,
    HttpClientModule,
    NbAuthModule.forRoot({
      strategies: [
        AzureADB2CAuthStrategy.setup({
          name: 'azure',
          clientId: 'bde728e2-2809-4ff1-bc9c-7fcb23800ebe',
          clientSecret: '',
          authorize: {
            endpoint: 'https://login.microsoftonline.com/01513fd2-16a0-453b-9fa0-c9089bfa023e/oauth2/authorize',
            responseType: 'id_token',
            scope: 'openid',
            redirectUri: 'https://akveo.github.io/nebular/example/azure/callback',
            params: {
              p: 'b2c_1_nebular',
            },
          },
          token: {
            class: AuthAzureToken,