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

Unable to login when external browser authentication setting is turned on #2642

Open
hemantsumanmetacube opened this issue Dec 2, 2024 · 1 comment

Comments

@hemantsumanmetacube
Copy link

Please fill out the following details:

  1. Version of Mobile SDK Used: v12.0.1
  2. Issue found in Native App or Hybrid App: Hybrid
  3. OS Version: Android 13 and 14
  4. Error Log:

2024-12-02 17:32:35.712 32316-32483 OAuthWebViewHelper com.tier1crm.tier1mobilenow D token response -> null 2024-12-02 17:32:35.896 32316-32483 .tier1mobilenow com.tier1crm.tier1mobilenow W Verification of java.lang.Object com.salesforce.androidsdk.ui.OAuthWebviewHelper$onAuthFlowComplete$1.invokeSuspend(java.lang.Object) took 172.044ms (499.87 bytecodes/s) (3744B approximate peak alloc) 2024-12-02 17:32:39.561 32316-32483 OAuthWebViewHelper com.tier1crm.tier1mobilenow W Exception thrown while retrieving token response java.lang.NullPointerException: Parameter specified as non-null is null: method okhttp3.Request$Builder.url, parameter url at okhttp3.Request$Builder.url(Unknown Source:2) at com.salesforce.androidsdk.auth.OAuth2.callIdentityService(OAuth2.java:426) at com.salesforce.androidsdk.ui.OAuthWebviewHelper$FinishAuthTask.performRequest(OAuthWebviewHelper.kt:1204) at com.salesforce.androidsdk.ui.OAuthWebviewHelper$FinishAuthTask.performRequest(OAuthWebviewHelper.kt:1199) at com.salesforce.androidsdk.ui.OAuthWebviewHelper$BaseFinishAuthFlowTask.doInBackground(OAuthWebviewHelper.kt:966) at com.salesforce.androidsdk.ui.OAuthWebviewHelper$BaseFinishAuthFlowTask$execute$2.invokeSuspend(OAuthWebviewHelper.kt:949) at com.salesforce.androidsdk.ui.OAuthWebviewHelper$BaseFinishAuthFlowTask$execute$2.invoke(Unknown Source:8) at com.salesforce.androidsdk.ui.OAuthWebviewHelper$BaseFinishAuthFlowTask$execute$2.invoke(Unknown Source:4) at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:78) at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:167) at kotlinx.coroutines.BuildersKt.withContext(Unknown Source:1) at com.salesforce.androidsdk.ui.OAuthWebviewHelper$BaseFinishAuthFlowTask.execute$SalesforceSDK_debug(OAuthWebviewHelper.kt:948) at com.salesforce.androidsdk.ui.OAuthWebviewHelper$onAuthFlowComplete$1.invokeSuspend(OAuthWebviewHelper.kt:836) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115) at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:100) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684) 2024-12-02 17:32:39.574 32316-32483 OAuthWebViewHelper com.tier1crm.tier1mobilenow E Error: Authentication error. Please try again. java.lang.NullPointerException: Parameter specified as non-null is null: method okhttp3.Request$Builder.url, parameter url at okhttp3.Request$Builder.url(Unknown Source:2) at com.salesforce.androidsdk.auth.OAuth2.callIdentityService(OAuth2.java:426) at com.salesforce.androidsdk.ui.OAuthWebviewHelper$FinishAuthTask.performRequest(OAuthWebviewHelper.kt:1204) at com.salesforce.androidsdk.ui.OAuthWebviewHelper$FinishAuthTask.performRequest(OAuthWebviewHelper.kt:1199) at com.salesforce.androidsdk.ui.OAuthWebviewHelper$BaseFinishAuthFlowTask.doInBackground(OAuthWebviewHelper.kt:966) at com.salesforce.androidsdk.ui.OAuthWebviewHelper$BaseFinishAuthFlowTask$execute$2.invokeSuspend(OAuthWebviewHelper.kt:949) at com.salesforce.androidsdk.ui.OAuthWebviewHelper$BaseFinishAuthFlowTask$execute$2.invoke(Unknown Source:8) at com.salesforce.androidsdk.ui.OAuthWebviewHelper$BaseFinishAuthFlowTask$execute$2.invoke(Unknown Source:4) at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:78) at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:167) at kotlinx.coroutines.BuildersKt.withContext(Unknown Source:1) at com.salesforce.androidsdk.ui.OAuthWebviewHelper$BaseFinishAuthFlowTask.execute$SalesforceSDK_debug(OAuthWebviewHelper.kt:948) at com.salesforce.androidsdk.ui.OAuthWebviewHelper$onAuthFlowComplete$1.invokeSuspend(OAuthWebviewHelper.kt:836) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115) at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:100) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684) 2024-12-02 17:32:39.581 32316-32316 Compatibil...geReporter com.tier1crm.tier1mobilenow D Compat change id reported: 147798919; UID 10468; state: ENABLED

@hemantsumanmetacube
Copy link
Author

In OauthWebViewHelper.kt file, after user is logged in, onAuthFlowComplete is called, the first parameter tr is null.

open fun onAuthFlowComplete(tr: TokenEndpointResponse?, nativeLogin: Boolean = false) {
d(TAG, "token response -> $tr")
CoroutineScope(IO).launch {
try{
FinishAuthTask().execute(tr, nativeLogin)
}catch (e:Exception){
e.message?.let { Log.d("tag", it) }
}
}
}

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