Pārlūkot izejas kodu

making flow implicit; fixing remote endpoint

Grega Bremec 1 gadu atpakaļ
vecāks
revīzija
9767fdaa1c
1 mainītis faili ar 4 papildinājumiem un 4 dzēšanām
  1. 4 4
      marketing-frontend/src/main/webapp/app.js

+ 4 - 4
marketing-frontend/src/main/webapp/app.js

@@ -1,6 +1,6 @@
 
 var keycloak = new Keycloak();
-var serviceUrl = 'http://localhost:3000/campaign'
+var serviceUrl = 'http://workstation.lab.example.com:3000/campaign'
 
 function notAuthenticated() {
     document.getElementById('not-authenticated').style.display = 'block';
@@ -17,8 +17,8 @@ function showTokens(){
    
     document.getElementById("idtoken").innerHTML = "ID Token</br>"+JSON.stringify(jwt_decode(keycloak.idToken), null, '  ');
     document.getElementById("accesstoken").innerHTML = "Access Token (bearer)</br>"+JSON.stringify(jwt_decode(keycloak.token), null, '  ');
-    document.getElementById("refreshtoken").innerHTML = "Refresh Token</br>"+JSON.stringify(jwt_decode(keycloak.refreshToken), null, '  ');
-   //document.getElementById("output").innerHTML = jwt_decode(keycloak.showToken);
+    //document.getElementById("refreshtoken").innerHTML = "Refresh Token</br>"+JSON.stringify(jwt_decode(keycloak.refreshToken), null, '  ');
+    //document.getElementById("output").innerHTML = jwt_decode(keycloak.showToken);
 }
 function request(endpoint) {
     var req = function() {
@@ -56,7 +56,7 @@ function request(endpoint) {
 }
 
 window.onload = function () {
-    keycloak.init({ onLoad: 'check-sso', checkLoginIframeInterval: 1 }).success(function () {
+    keycloak.init({ onLoad: 'check-sso', flow: 'implicit', checkLoginIframeInterval: 1 }).success(function () {
         if (keycloak.authenticated) {
             authenticated();
         } else {