Open damithmalalanayake opened 3 years ago
I'm having a similar question. After logging into Keycloak, it redirects to the app in the browser so it just shows the web app, but doesn't actually redirect to the Capacitor app. Did you find an answer to this?
I am using this Plugin in my Ionic Angular App with Capacitor v2. To bring the redirect URL tow work I use Capacitors Build In DeepLinks on IOS and Android. https://capacitorjs.com/docs/v2/guides/deep-links. I Initialize the ionic keycloak Adapter in my Login Component. See here. The DeeplinkingSheme is the string i configured as Capcitor DeepLink, see link above.
const appPrefix = `${deepLinkingScheme}://app`;
const path = 'login';
const redirectUri = `${appPrefix}/${path}`;
this.keycloak
.init({
adapter: 'capacitor-native',
responseMode: 'query',
redirectUri: redirectUri
})
Path is probably optional. In my Cases the user is redirected back to the app and remains in the view, where he did trigger the Login. Then I check is the user authorized and route him to the next view with Angulars Router serverice.
${deepLinkingScheme}
Hi @Alfer-Star what could be the possible values of ${deepLinkingScheme}?
We used a simplified version of our app name like "myapp". I think that is the recommended way to use something unique, because in such a way your deeplink will unlikely collide with an other deeplink.
Is that app name coming from ionic.config.json or package.json ?