JohannesBauer97 / keycloak-ionic

Keycloak Capacitor Adapter for Ionicframework
https://www.npmjs.com/package/keycloak-ionic
Apache License 2.0
16 stars 19 forks source link

ERROR TypeError: Cannot read property 'Plugins' of undefined #8

Closed santoshshinde2012 closed 3 years ago

santoshshinde2012 commented 3 years ago

Trying to create an example with this module but getting the following error

ERROR TypeError: Cannot read property 'Plugins' of undefined

image

okaa-pi commented 3 years ago

Are you trying on a browser? This plugin only works inside an Android / iOS device via ionic capacitor run android for example.

santoshshinde2012 commented 3 years ago

yes, But what about the browser?

okaa-pi commented 3 years ago

I didn't try it out, but I suppose you could add a check if you're in a browser init the Keycloak client with a different adapter, and if you're in a mobile app, use the capacitor adapter?

I'm not a contributor to the project btw, just strolling by :)

JohannesBauer97 commented 3 years ago

Hi, the browser implementation should work as described in the official docs: https://www.keycloak.org/docs/latest/securing_apps/index.html#_javascript_adapter

If not, could you please add here some code snippets about the usage?