Closed toothbrush closed 3 years ago
You know what, i don't know what i was doing wrong, but it works as it should. Closing this issue – apologies for the noise.
You don't need to store the code verifier and code challenge in persistent storage. You regenerate those values before each authorization request.
Hello again! Way back when i created my first prototype application, i was able to follow https://github.com/Peter-Schorn/SpotifyAPI/wiki/Saving-authorization-information-to-persistent-storage to authorise my app once, then subsequently rely on the authorisation data stored in the keychain.
Now that i want to make it possible for others to download my app, it seemed good to switch to using
AuthorizationCodeFlowPKCEManager
so that i needn't distribute theclientSecret
value with my app.However, having adapted the code from https://github.com/Peter-Schorn/SpotifyAPI/wiki/Saving-authorization-information-to-persistent-storage to use
AuthorizationCodeFlowPKCEManager
, it appears my app is unable to reuse stored authorisation info from the Keychain between runs. I would guess it's because i should also store the corresponding random-generatedcodeVerifier
andcodeChallenge
, but i don't see anywhere they're being used in this bit:Is it possible to restore a saved session when i'm avoiding using
clientSecret
?