Ionic for JHipster with OIDC

82 views
Skip to first unread message

Matt Raible

unread,
Jan 16, 2018, 8:03:50 PM1/16/18
to JHipster dev team
Hello all,

I did some hacking today and was able to get OIDC working with a JHipster backend an an Ionic app on the frontend. I had to make some modifications in the backend for this to work:

1. Add http://localhost:8100 as a valid redirect URI in Keycloak.
2. Turn on Implicit Flow for the “web_app” client in Keycloak.
3. Add @EnableResourceServer to the SecurityConfiguration.java class.
4. Change the default port from 8080 to something else when running in iOS Emulator. This is necessary because the emulator runs on 8080.

Ideally, none of this would be necessary and I could just call “http://localhost:8080/login”, but while the redirecting works, the cookies don’t seem to be set and calls the API fail.

I used angular-oauth2-oidc to make things work, and my proof of concept shows it works with both Keycloak and Okta.

Do y’all think it’d be OK to modify the default Keycloak realm to have the first two changes? If not, I can do it as part of my module. I have to do #3 anyway. I have a warning about the 4th point as part of the generation process. I’ve attached a screenshot below.

Thanks,

Matt

Julien Dubois

unread,
Jan 18, 2018, 10:53:41 AM1/18/18
to Matt Raible, JHipster dev team
Hi Matt,

I'm not sure of the consequences, but if modifying Keycloak is better for you, you should do it. This is mainly an example setup, I don't think people will use this in production directly anyway.

Julien

--
You received this message because you are subscribed to the Google Groups "JHipster dev team" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jhipster-dev+unsubscribe@googlegroups.com.
To post to this group, send email to jhipst...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jhipster-dev/9A525518-92B3-4B7A-89EE-02066E9EDA14%40raibledesigns.com.
For more options, visit https://groups.google.com/d/optout.



--
Julien Dubois

Twitter: @juliendubois

Reply all
Reply to author
Forward
0 new messages