PKCE support is controlled by the useProofKeyForCodeExchange property, and the use_pkce key in the settings dictionary. It is disabled by default. When enabled, a new code verifier string is generated for every authorization request.
I have added:
let oauth2 = OAuth2CodeGrant(settings: [ "client_id": clientID, "client_secret": clientSecret, "authorize_uri": "https://api.redacted.com/oauth/authorize", "token_uri": "https://api.redacte4d.com/oauth/token", // code grant only "redirect_uris": [redirectURL], "scope": scope, "secret_in_body": false, "keychain": false, "use_pkce": true, ] as OAuth2JSON)
I have no idea where I'm supposed to use "useProofKeyForCodeExchange" and when I search the pod's code I can't find either useProofKeyForCodeExchange or use_pkce referenced anywhere.
PKCE support has been added in 5.1.1. Cocoapods support has been dropped in version 5, you can use SPM to add OAuth2, see https://github.com/p2/OAuth2#installation .
re: pod 'p2.OAuth2', '~> 4.2'
The documentation says,
I have added:
let oauth2 = OAuth2CodeGrant(settings: [ "client_id": clientID, "client_secret": clientSecret, "authorize_uri": "https://api.redacted.com/oauth/authorize", "token_uri": "https://api.redacte4d.com/oauth/token", // code grant only "redirect_uris": [redirectURL], "scope": scope, "secret_in_body": false, "keychain": false, "use_pkce": true, ] as OAuth2JSON)
I have no idea where I'm supposed to use "useProofKeyForCodeExchange" and when I search the pod's code I can't find either useProofKeyForCodeExchange or use_pkce referenced anywhere.