1

I am working on an iOS app in swift 4 that uses Groupme Oauth. When the user clicks login for the first time, a safari browser opens and they are taken to Groupme's oauth page where they are prompted to enter their credentials. After verification, they are asked to return to the app.

When I log out and attempt login via Groupme a second time, the safari browser opens but the instead of presenting a fresh login screen for Groupme, the permission prompt which asks to return back to the app appears. So that means the previous user's access-token is automatically returned in the callback url instead of giving the current user an opportunity to log in and clearly that's no good.

So far, they only way I've been able to get around this was to manually delete Groupme info in my safari browser. Am I able to open the url in incognito mode or programmatically clear the cache? Any help is appreciated, thanks.

PS I've tried these, to see if it'd be different but to no avail:

UIApplication.shared.openURL(authURL!) WKWebView.load(authURL!)

Ashlyn
  • 11
  • 2
  • You should be able to use a `WKWebView` and associated [`WKWebsiteDataStore`](https://developer.apple.com/documentation/webkit/wkwebsitedatastore?language=objc) to manage the cookies – Paulw11 Oct 28 '18 at 21:43

1 Answers1

0

I faced the same problem. This feature has to be implemented server-side. You can clear the cookies in the iPhone preferences. Only this can help.

The other approach is to use old API – openUrl with safari browser link.

Vyacheslav
  • 26,359
  • 19
  • 112
  • 194