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

The login is not redirecting to the iOS app #205

Open
migue99angel opened this issue Jun 7, 2022 · 3 comments
Open

The login is not redirecting to the iOS app #205

migue99angel opened this issue Jun 7, 2022 · 3 comments

Comments

@migue99angel
Copy link

migue99angel commented Jun 7, 2022

Description

We are trying to integrate the Google social login, we have tried the plugin in web and Android and it works fine. But we have a problem with the iOS app. The app uses the web configuration on iOS, this way the redirectUrl used is the same url used in web instead of the url we have defined in the iOS configuration (The app's bundle ID)

Capacitor version:

Run npx cap doctor:
💊 Capacitor Doctor 💊

Latest Dependencies:

@capacitor/cli: 3.5.1
@capacitor/core: 3.5.1
@capacitor/android: 3.5.1
@capacitor/ios: 3.5.1

Installed Dependencies:

@capacitor/cli: 3.3.0
@capacitor/core: 3.3.0
@capacitor/android: 3.4.1
@capacitor/ios: 3.4.1

[success] Android looking great! 👌
[success] iOS looking great! 👌

Library version:

  • 3.0.1

OAuth Provider:

  • Google

Your Plugin Configuration

    OAuth2Client.authenticate({
      appId: '',
      scope: 'email profile',
      resourceUrl: 'https://www.googleapis.com/userinfo/v2/me',
      logsEnabled: true,
      authorizationBaseUrl: 'https://accounts.google.com/o/oauth2/auth',
      web: {
        appId: environment.oauthAppId.google.web,
        responseType: 'token', 
        accessTokenEndpoint: '', 
        redirectUrl: environment.oauthRedirectPath,
        windowReplace: false,
        windowOptions: 'width=500,height=600,left=0,top=0',
      },
      android: {
        appId: environment.oauthAppId.google.android,
        responseType: 'code', // if you configured a android app in google dev console the value must be "code"
        redirectUrl: 'my.android.id:/', // package name from google dev console
      },
      ios: {
        appId: environment.oauthAppId.google.ios,
        responseType: 'code', // if you configured a ios app in google dev console the value must be "code"
        redirectUrl: 'my.apple.id:/', // Bundle ID from google dev console
      },
    }

Affected Platform(s):

  • iOS
    • Version/API Level:
    • Device Model: any device
    • Content of your Info.plist
<key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleTypeRole</key>
            <string>Editor</string>
            <key>CFBundleURLName</key>
            <string>my.apple.id</string>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>my.apple.id</string>
            </array>
        </dict>
        <dict/>
    </array>
@sallyg1
Copy link

sallyg1 commented Aug 19, 2022

Hi , did you find solution to this problem? I am using Azure AD b2c , login is working fine in web but redirection is not working on android. it always picks up localhost:8100, web configuration

@arturomf
Copy link

Hi, I have the same problem on IOS, after successful login, I can detect the redirection URL in my capacitor-Ionic app, but the browser doesn't close...

@di-appteam
Copy link

Hi , did you find solution to this problem? I am using Azure AD b2c , login is working fine in web but redirection is not working on android. it always picks up localhost:8100, web configuration

do you have any update? I am facing same issue.

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