Remove oauth
This commit is contained in:
@@ -6,7 +6,7 @@ import {
|
||||
} from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
|
||||
import { AppCommonModule,AppCommonServiceModule,AuthConfigFactory,FM_COMMON_STARTPAGE } from '@farmmaps/common';
|
||||
import { AppCommonModule,AppCommonServiceModule,FM_COMMON_STARTPAGE } from '@farmmaps/common';
|
||||
|
||||
import {AppRootComponent} from './app.component';
|
||||
|
||||
@@ -18,8 +18,6 @@ import {AppRoutingModule} from './app-routing.module';
|
||||
import { LogoComponent } from './logo/logo.component';
|
||||
import { MenuComponent } from './menu/menu.component';
|
||||
import {RegisterDeviceComponent} from './registerdevice/registerdevice.component';
|
||||
import { SecureOAuthStorage} from '@farmmaps/common';
|
||||
import { OAuthStorage } from 'angular-oauth2-oidc';
|
||||
import {Id4AuthconfigFactory} from './id4AuthconfigFactory';
|
||||
import { TestComponent } from './test/test.component';
|
||||
import { LandingpageComponent } from './landingpage/landingpage.component';
|
||||
@@ -85,11 +83,6 @@ export const metaReducers: MetaReducer<any>[] = [debug];
|
||||
EffectsModule.forRoot([]),
|
||||
],
|
||||
providers: [
|
||||
AuthConfigFactory,
|
||||
{
|
||||
provide:AuthConfigFactory,
|
||||
useClass:Id4AuthconfigFactory
|
||||
},
|
||||
{
|
||||
provide: FM_COMMON_STARTPAGE,
|
||||
useValue: '/map'
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
import { IAuthconfigFactory, AppConfig } from '@farmmaps/common';
|
||||
import { AuthConfig } from 'angular-oauth2-oidc';
|
||||
import { Injectable } from "@angular/core";
|
||||
|
||||
@Injectable()
|
||||
export class Id4AuthconfigFactory implements IAuthconfigFactory {
|
||||
constructor() {
|
||||
|
||||
}
|
||||
|
||||
getAuthConfig(appConfig: AppConfig): AuthConfig {
|
||||
const authConfig: AuthConfig = new AuthConfig();
|
||||
authConfig.issuer = appConfig.getConfig("issuer");
|
||||
authConfig.redirectUri = window.location.origin + "/cb";
|
||||
authConfig.clientId = appConfig.getConfig("clientId");
|
||||
authConfig.customQueryParams = { audience: appConfig.getConfig("audience") };
|
||||
authConfig.scope = "openid profile api offline_access";
|
||||
authConfig.disableAtHashCheck = true;
|
||||
authConfig.responseType = "code";
|
||||
authConfig.requireHttps = appConfig.getConfig("requireHttps");
|
||||
return authConfig;
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
import {IAuthconfigFactory,AppConfig} from '@farmmaps/common';
|
||||
import {AuthConfig} from 'angular-oauth2-oidc';
|
||||
|
||||
export class LocalAuthconfigFactory implements IAuthconfigFactory {
|
||||
getAuthConfig(appConfig:AppConfig): AuthConfig {
|
||||
const authConfig: AuthConfig = new AuthConfig();
|
||||
authConfig.issuer = appConfig.getConfig("issuer");
|
||||
authConfig.redirectUri = window.location.origin + "/cb";
|
||||
authConfig.silentRefreshRedirectUri = window.location.origin + "/silent-refresh.html";
|
||||
authConfig.clientId = appConfig.getConfig("clientId");
|
||||
authConfig.customQueryParams = { audience: appConfig.getConfig("audience") };
|
||||
authConfig.scope = "openid profile email";
|
||||
authConfig.oidc = true;
|
||||
authConfig.disableAtHashCheck = true;
|
||||
authConfig.openUri = uri => {
|
||||
window.alert("OK "+uri);
|
||||
}
|
||||
authConfig.requireHttps = appConfig.getConfig("requireHttps");
|
||||
return authConfig;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user