Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What should be the redirect URL to return back to app? #15

Open
damithmalalanayake opened this issue Sep 22, 2021 · 4 comments
Open

What should be the redirect URL to return back to app? #15

damithmalalanayake opened this issue Sep 22, 2021 · 4 comments

Comments

@damithmalalanayake
Copy link

Is that app name coming from ionic.config.json or package.json ?

@krishopper
Copy link

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?

@Alfer-Star
Copy link

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.

@itstyro
Copy link

itstyro commented Jul 20, 2022

${deepLinkingScheme}

Hi @Alfer-Star what could be the possible values of ${deepLinkingScheme}?

@Alfer-Star
Copy link

Alfer-Star commented Jul 20, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants