Ionic 2:通过keycloak登录不会存储keycloak cookies [英] Ionic 2: login via keycloak won't store keycloak cookies
问题描述
我正在构建Ionic 2应用程序,我想使用Keycloak进行登录/注册。
I am building Ionic 2 app and I want to use Keycloak for login/signup.
我有以下情况:
我在Keycloak登录页面上,当我登录时,我将重定向回我的应用程序。我希望Keycloak会设置cookie,但事实并非如此。我想这是因为:你可以在Cordova应用程序中使用cookies吗? ?。
I am on Keycloak login page and when I login, I am redirect back to my app. I would expect that Keycloak will set cookies, but it didn't. I guess it is because of this: Can you use cookies in a Cordova application?.
有没有办法告诉Keycloak使用本地存储而不是cookie。或者任何其他解决方案?
Is there any way how to tell Keycloak to use local storage instead of cookies. Or any other solution?
我正在使用实施的keycloak&角度2合作。
I am using this implementation of keycloak & angular 2 colaboration.
推荐答案
在Keycloak中有一个 Javascript Adapter - keycloak.js,它已经知道如何使用Cordova应用程序,它只需要禁用令牌检查通过iframe。
In the Keycloak there is a Javascript Adapter - keycloak.js, it already knows how to work with a Cordova application, it is only necessary to disable the token checking through the iframe.
我创建了一个简单的应用程序Ionic2与Keycloak集成 https://github.com/sergeyrolich/ionic2-keycloak
I created a simple app Ionic2 with Keycloak integration https://github.com/sergeyrolich/ionic2-keycloak
这篇关于Ionic 2:通过keycloak登录不会存储keycloak cookies的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!