I've a solution by deporting the call of the URL which logs the user (with the Oauth token stored in keychain) from viewDidAppear to viewDidLoad
Post
Replies
Boosts
Views
Activity
I've solved this issue, I just had to clean cookies for the SFSafariViewController (I've done that in PHP)
I've tried to empty keychain but maybe I need to access data stored with accounts keychainAccountForClientCredentials and keychainAccountForTokens, is this possible and how?
EDIT2: I've tried
appDelegate.oauth2?.forgetClient()
appDelegate.oauth2 = OAuth2CodeGrant(settings: OAuthParams )
appDelegate.oauth2!.authConfig.authorizeContext = KronosWebsite?.window//KronosWebsite the WKWebview
runOauth()`
and in the console I've this now
[Debug] OAuth2: Forgetting client credentials and removing them from keychain [Warn!] OAuth2: Failed to delete credentials from keychain: Error Domain=swift.keychain.error Code=-25300 "(null)"
EDIT: In fact the first logoff woks well but if I relog I can not sign off anymore and I have that line in the console when it fail
[Debug] OAuth2: Did exchange code for access [true] and refresh [true] tokens
maybe this issue is the call to hash_hmac, I have a key like this:
$pem_content = "
-----BEGIN PRIVATE KEY-----
XXXX
-----END PRIVATE KEY-----";
but I don't know how to use it as the 3rd parameter of hash_hmac