-
Notifications
You must be signed in to change notification settings - Fork 390
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
Comments
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) { |
Edit: Sorry, I read this log line wrong (since it has changed since 12.0.1). I thought the package name was the url of the token response. |
I don't think this is the case, I am trying to login to a org and using this url -> https://*.sandbox.my.salesforce.com |
@hemantsumanmetacube Is this a consistent issue? Is the sandbox org you are logging into added to the servers list or thought the "Use Custom Domain" button in the webview? |
Yes, this is a consistent issue. It is added in the servers list and trying to login after that. |
Are you using browser based authentication? If so which browser? If you got to the native identity call I assume that means the necessary intent filter is correct. Are you using the default Web Server flow or User Agent flow for authentication? What OAuth scopes are selected on the connected app? What are the OAuth Policies and Session Policies of the connected app? |
@hemantsumanmetacube Is require secret for web server flow unchecked in your connected app? ![]() |
Yes, it is unchecked |
After further debugging, i found that makeTokenEndpointRequest function in OAuth2.java file is called to and it makes a POST REST Call to https://qamain--sb1.sandbox.my.salesforce.com/services/oauth2/token?device_id=DEVICE_ID, In response we get 400 and thus the token is set to null. private static TokenEndpointResponse makeTokenEndpointRequest(HttpAccess httpAccessor, |
External Browser authentication is also not working on freshly created app using forcehybrid. Getting below error: Exception occurred while making token request |
Sorry, the team was busy with planning last week. Is this on |
i am getting the same error with SalesforceMobileSDK 12.2.0 2024-12-23 15:01:42.446 12859-13049 OAuthWebViewHelper com.tier1crm.tier1mobilenow E Exception occurred while making token request |
@brandonpage Any update regarding this issue. |
@brandonpage Any update regarding this issue. |
Please fill out the following details:
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
The text was updated successfully, but these errors were encountered: