2

I have MyApp - Ionic 2 app and I would like to implement login via Keycloak as you can see here here.

MyApp is runnig on http://localhost:8100/

Keycloak server on http://localhost:8080/

Have following scenario:

  1. User Access MyApp and press login button.
  2. User is redirect to Keycloak page, fills the credentials and press the login.
  3. User is redirected back to MyApp:

enter image description here

Here is the issue: The MyApp will not store the cookies from Keycloak response (see here). So I was thinking about catching the redirect from Keycloak, extracting the cookies and storing them into LocalStorage. I don't know how in Angular 2 catch such redirect.

Thanks for any advice!

Community
  • 1
  • 1
Tomas Marik
  • 4,053
  • 3
  • 31
  • 62

1 Answers1

1

In the Keycloak there is a Javascript Adapter - keycloak.js, it already knows how to work with a Cordova application.

Your another question already has an answer, how to work with this js adapter Ionic 2: login via keycloak won't store keycloak cookies

Segavax
  • 136
  • 2
  • 8