okta / okta-mobile-kotlin

Okta's Android Authentication SDK
https://okta.github.io/okta-mobile-kotlin/
Apache License 2.0
35 stars 12 forks source link

Add state parameter to AuthorizationCodeFlow.start #278

Closed rajdeepnanua-okta closed 9 months ago

rajdeepnanua-okta commented 9 months ago

This PR adds state parameter to AuthorizationCodeFlow.start as requested by #276.

This PR also fixes some issues related to DeviceTokenCookie initialization with the following:

  1. Lazily loading DT cookie in DeviceTokenCookieJar to avoid crashes when users create OidcConfiguration in a Jetpack startup initializer.
  2. Attempting to reinitialize DeviceTokenProvider's storage by deleting the storage during Exception, and then recreating the storage.

These should fix most of the issues reported by users. The only exception being if the encryption key is itself corrupted, which can happen and has been reported as an issue for EncryptedSharedPreferences. But, that case should be much rarer than the issues addressed by the above two fixes.