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

Call back function is not returning the value #223

Open
manoj1976 opened this issue Dec 26, 2022 · 0 comments
Open

Call back function is not returning the value #223

manoj1976 opened this issue Dec 26, 2022 · 0 comments

Comments

@manoj1976
Copy link

Description

Capacitor version:

Run npx cap doctor:

Latest Dependencies:

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

Installed Dependencies:

  @capacitor/ios: not installed
  @capacitor/cli: 4.6.1
  @capacitor/core: 4.6.1
  @capacitor/android: 4.6.1

Library version:

  • 3.0.1

OAuth Provider:

  • Azure AD (B2C)

Your Plugin Configuration

{
    getLogoutOptions(): OAuth2AuthenticateOptions {
    return {
      //appId: environment.oauthAppId.azureBc2.appId,
      appId: environment.appid,
      authorizationBaseUrl: 'https://login.microsoftonline.com/XXX/oauth2/v2.0/authorize',
      scope: "https://graph.microsoft.com/User.Read", // See Azure Portal -> API permission
      accessTokenEndpoint: 'https://login.microsoftonline.com/XXX/oauth2/v2.0/token',
      resourceUrl: "https://graph.microsoft.com/v1.0/me/",
      responseType: "code",
      pkceEnabled: true,
      logsEnabled: true,
      web: {
        redirectUrl: environment.redirectUrl,
        windowOptions: "height=600,left=0,top=0",
      },
      android: {
        redirectUrl: "msauth://XXX"
      },
      ios: {
        pkceEnabled: true, // workaround for bug #111
        redirectUrl: "msauth.{package-name}://auth"
      }
    };
  }
}

Affected Platform(s):

  • Android

    • Content of your AndroidManifest.xml

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">

    <activity
        android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode"
        android:name="ie.prostrategy.oauthtest.MainActivity"
        android:label="@string/title_activity_main"
        android:theme="@style/AppTheme.NoActionBarLaunch"
        android:launchMode="singleTask"
        android:exported="true">

        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>


        <intent-filter>
            <!--manoj-->
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="@string/custom_url_scheme" android:host="@string/custom_host" />
            
            <data android:scheme="@string/azure_b2c_scheme" android:host="@string/package_name" android:path="@string/azure_b2c_signature_hash" />

        </intent-filter>

    </activity>

    <provider
        android:name="androidx.core.content.FileProvider"
        android:authorities="${applicationId}.fileprovider"
        android:exported="false"
        android:grantUriPermissions="true">
        <meta-data
            android:name="android.support.FILE_PROVIDER_PATHS"
            android:resource="@xml/file_paths"></meta-data>
    </provider>
    <!--manoj-->
     <activity
        android:name="com.microsoft.identity.client.BrowserTabActivity"
        android:exported="true">
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="@string/azure_b2c_scheme" android:host="@string/package_name" android:path="@string/azure_b2c_signature_hash" />
             <!--<data android:scheme="@string/custom_url_scheme" android:host="oauth" />-->
             <data android:scheme="@string/custom_url_scheme" android:host="@string/custom_host" />
            <data android:scheme="msauth"
                android:host="ie.prostrategy.oauthtest"
                android:path="/anTrw8Xj5bDQyFFO49XzoeQLN9c=" />
        </intent-filter>
    </activity>
</application>

<!-- Permissions -->

<uses-permission android:name="android.permission.INTERNET" />
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

1 participant