import { BrowserModule } from '@angular/platform-browser'; import { AppRoutingModule } from "./app-routing.module"; import { NgModule, ErrorHandler } from '@angular/core'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { AppComponent } from './app.component'; import {HTTP_INTERCEPTORS, HttpClientModule} from "@angular/common/http"; import { ErrorService } from './core/error.service'; //import { CoredataService } from './services/coredata.service'; import { ErrorHttpService } from './core/error-http.service'; import { MasterComponent } from './views/master/master.component'; import '@fortawesome/fontawesome-free/js/all.js'; import { BreadcrumbComponent } from './views/master/breadcrumb/breadcrumb.component'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; //Notification toast import { ToastrModule } from 'ngx-toastr'; //global loader import { NgHttpLoaderModule } from 'ng-http-loader'; // Application Title import { AppTitleService } from './utilities/app-title-service'; // import { LoginComponent } from './views/login/login.component'; import { IPublicClientApplication, PublicClientApplication, InteractionType, BrowserCacheLocation, LogLevel } from '@azure/msal-browser'; import { MsalGuard, MsalInterceptor, MsalBroadcastService, MsalInterceptorConfiguration, MsalModule, MsalService, MSAL_GUARD_CONFIG, MSAL_INSTANCE, MSAL_INTERCEPTOR_CONFIG, MsalGuardConfiguration } from '@azure/msal-angular'; import { AdminInformationComponent } from './views/admin-information/admin-information.component'; import { TermsofUseComponent } from './views/termsof-use/termsof-use.component'; import { PrivacyPolicyComponent } from './views/privacy-policy/privacy-policy.component'; import { OrderSamplesAndLiteratureComponent } from './views/marketing-resource/order-samples-and-literature/order-samples-and-literature.component'; import { TrainingEventsComponent } from './views/TrainingAndEvents/training-events/training-events.component'; import { AnnouncementsComponent } from './views/announcements/announcements.component'; import { LoginTermsofUseComponent } from './views/login-termsof-use/login-termsof-use.component'; import { LoginPrivacyPolicyComponent } from './views/login-privacy-policy/login-privacy-policy.component'; import { UserprofileModule } from './views/userprofile/userprofile.module'; //import { LocationStrategy } from '@angular/common'; //import { HashLocationStrategy } from '@angular/common'; import { RouterModule,Routes } from '@angular/router'; import { DataTablesModule } from 'angular-datatables'; import { NgxPaginationModule } from 'ngx-pagination'; import { MatSliderModule } from '@angular/material/slider'; import { NgxMatSelectSearchModule } from 'ngx-mat-select-search'; import { NgSelectModule } from '@ng-select/ng-select'; //import { SocialAuthServiceConfig, SocialLoginModule } from 'angularx-social-login'; //import { // GoogleLoginProvider, // FacebookLoginProvider //} from 'angularx-social-login'; import {SocialLoginModule,AuthServiceConfig,FacebookLoginProvider, AuthService, GoogleLoginProvider } from 'ng-social-login-module'; import { NgbModule } from '@ng-bootstrap/ng-bootstrap'; import { NgbDatepickerConfig, NgbDateParserFormatter } from '@ng-bootstrap/ng-bootstrap'; import { NgbDateParserFormatterEsMX } from './utilities/date-parse-formatter'; import { DatePipe } from '@angular/common'; import { LogoutInterceptor } from 'src/app/services/managehttp.interceptor'; const CONFIG = new AuthServiceConfig( [ { id: GoogleLoginProvider.PROVIDER_ID, provider: new GoogleLoginProvider('1010586544600-frjv4oh6j4giv7dqbor6ikuc1vrcb40n.apps.googleusercontent.com') }, { id: FacebookLoginProvider.PROVIDER_ID, provider: new FacebookLoginProvider('2315982045201628') } ], true); export function provideConfig() { return CONFIG; } const isIE = window.navigator.userAgent.indexOf("MSIE ") > -1 || window.navigator.userAgent.indexOf("Trident/") > -1; export function loggerCallback(logLevel, message) { } export function MSALInstanceFactory(): IPublicClientApplication { return new PublicClientApplication({ auth: { //clientId: 'fa83dec3-eebe-4bc3-a435-874c63a8fa7a', //redirectUri: '', //postLogoutRedirectUri: '' clientId: '33c6c2da-8f7c-4770-97be-0586f28e4b2e', redirectUri: '', postLogoutRedirectUri: '', authority: 'https://login.microsoftonline.com/216eaed7-f5c1-468e-b41a-1103408bccf9/' }, cache: { cacheLocation: BrowserCacheLocation.LocalStorage, storeAuthStateInCookie: isIE, // set to true for IE 11 }, system: { loggerOptions: { loggerCallback, logLevel: LogLevel.Info, piiLoggingEnabled: false } } }); } export function MSALInterceptorConfigFactory(): MsalInterceptorConfiguration { const protectedResourceMap = new Map>(); protectedResourceMap.set('https://graph.microsoft.com/v1.0/me', ['user.read']); return { interactionType: InteractionType.Redirect, protectedResourceMap }; } export function MSALGuardConfigFactory(): MsalGuardConfiguration { return { interactionType: InteractionType.Redirect }; } @NgModule({ declarations: [ AppComponent, MasterComponent, BreadcrumbComponent, // LoginComponent, AdminInformationComponent, TermsofUseComponent, PrivacyPolicyComponent, TrainingEventsComponent, AnnouncementsComponent, LoginTermsofUseComponent, LoginPrivacyPolicyComponent ], imports: [ BrowserModule, BrowserAnimationsModule, AppRoutingModule, FormsModule, ReactiveFormsModule, HttpClientModule, NgHttpLoaderModule.forRoot(), ToastrModule.forRoot(), MsalModule, UserprofileModule, DataTablesModule, NgxPaginationModule, SocialLoginModule, MatSliderModule, NgxMatSelectSearchModule, NgSelectModule, NgbModule ], providers: [ { provide: ErrorHandler, useClass: ErrorService }, { provide: HTTP_INTERCEPTORS, useClass: ErrorHttpService, multi: true }, { provide: HTTP_INTERCEPTORS, useClass: LogoutInterceptor, multi: true }, { provide: HTTP_INTERCEPTORS, useClass: MsalInterceptor, multi: true }, { provide: MSAL_INSTANCE, useFactory: MSALInstanceFactory }, { provide: MSAL_GUARD_CONFIG, useFactory: MSALGuardConfigFactory }, { provide: MSAL_INTERCEPTOR_CONFIG, useFactory: MSALInterceptorConfigFactory }, //{ // provide: 'SocialAuthServiceConfig', // useValue: { // autoLogin: false, // providers: [ // //{ // // id: GoogleLoginProvider.PROVIDER_ID, // // provider: new GoogleLoginProvider( // // 'clientId' // // ) // //}, // { // id: FacebookLoginProvider.PROVIDER_ID, // provider: new FacebookLoginProvider('2315982045201628') // } // ] // } as SocialAuthServiceConfig, //}, { provide: AuthServiceConfig,useFactory: provideConfig }, //{ // provide: LocationStrategy, // useClass: HashLocationStrategy //}, MsalService, MsalGuard, MsalBroadcastService, AppTitleService, /* { provide: NgbDateParserFormatter, useClass: NgbDateParserFormatterEsMX },*/ { provide: NgbDateParserFormatter, useValue: new NgbDateParserFormatterEsMX("MM/DD/YY") }, DatePipe ], bootstrap: [AppComponent] }) export class AppModule { }