3

My implementation of PKCE is pretty standard:

  1. Generate "code_challenge", "code_verifier" and "state"
  2. Open a ChomeCustomTab with a login/register UI, passing the "state" and "code_callenge"
  3. The user loggs in and the native app receives a callback, containing the "state"
  4. The app is verifying the "state" and triggering a request to get the JWT with the "code_verifier"

The issue is that the "code_verifier" and "state" are stored in the apps memory, and sometimes the Android system is killing the apps process while the user is in the ChomeCustomTab. The callback is received by a new app process that doesn’t have the "code_verifier" and "state" and they can’t be verified.

What are the best practices to store them? Is is safe to do it in device memory?

0 Answers0