forcedotcom / SalesforceMobileSDK-Android

Android SDK for Salesforce
Other
341 stars 386 forks source link

Token request error: invalid_grant:cannot perform hybrid grant with jwts enabled #2590

Closed LuoShao closed 2 months ago

LuoShao commented 3 months ago

Please fill out the following details:

  1. Version of Mobile SDK Used: 11.0.1
  2. Issue found in Native App or Hybrid App: Native App
  3. OS Version: 14
  4. Device: Huawei P20
  5. Steps to reproduce: After clicking the login button, token error
  6. Actual behavior: Token request error
  7. Expected Behavior: Successfully entered the app
  8. Error Log: Token request error: invalid_grant:cannot perform hybrid grant with jwts enabled
Screenshot 2024-07-03 at 15 32 42 Screenshot 2024-07-03 at 15 33 03
LuoShao commented 3 months ago

In the connect app, select JWT-Based Access Token Settings for Named Users

brandonpage commented 3 months ago

@LuoShao I am able to reproduce this issue, despite the fact that my connected app configuration is correct. This appears to be a regression on the server that is unfortunately out of our control.

I will reach out to the Authentication team internally, but if this is a blocking issue for you I suggest you contact Salesforce support through the standard channels as the issue may be resolved more quickly that way.

brandonpage commented 2 months ago

@LuoShao Apologies for not getting back to you sooner. In case you have not resolved this, the server does not yet support Hybrid auth codes with JWT-based access tokens. For the time being please set useHybridAuthentication (or setUseHybridAuthentication in Java) to false in SalesforceSDKManager or configure your connected app to use the standard opaque access tokens if you need a hybrid code.