From 1a0e0b13e70a9145a52c7ebcb01d4427ded628a4 Mon Sep 17 00:00:00 2001 From: Willem Dantuma Date: Tue, 14 Jan 2020 16:46:59 +0100 Subject: [PATCH] Make granttype configurable --- projects/common/src/fm/shared/app.config.factory.ts | 5 ++++- src/configuration.json | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/projects/common/src/fm/shared/app.config.factory.ts b/projects/common/src/fm/shared/app.config.factory.ts index 52df81c..d010b17 100644 --- a/projects/common/src/fm/shared/app.config.factory.ts +++ b/projects/common/src/fm/shared/app.config.factory.ts @@ -37,7 +37,10 @@ export function appConfigFactory(injector:Injector, appConfig: AppConfig, oauthS }).then(() => { let router = injector.get(Router); if (!oauthService.hasValidAccessToken()) { - oauthService.initImplicitFlow(urlPath); + if(appConfig.getConfig("grantType") == "code") + oauthService.initCodeFlow(urlPath); + else + oauthService.initImplicitFlow(urlPath); } else { router.navigateByUrl(urlPath); } diff --git a/src/configuration.json b/src/configuration.json index 73efb01..c7af92c 100644 --- a/src/configuration.json +++ b/src/configuration.json @@ -3,6 +3,7 @@ "clientId": "farmmaps", "audience": "http://farmmaps.awtest.nl/", "requireHttps": false, - "apiEndPoint": "http://farmmaps.awtest.nl" + "apiEndPoint": "http://farmmaps.awtest.nl", + "grantType":"implicit" } \ No newline at end of file