I tried to authenticate my app with spotifys api in order to get the users favorite songs but couldn’t get through the OAuth2 protocol.
I’ve tried the rever tutorial but It didn’t cache the tokens nor did it work properly.
I’ve looked at the AppAuth IOS Github repo and managed to include it but failed with SwiftUI.
My question is now regarding Appauth or any other oauth2 libraries: do I have to manually wrap all uidelegate an protocol classes in order to use it with swift ui?
I managed to reference The appdelegate in the main entry of my swiftui app but when it comes to this:
appDelegate.currentAuthorizationFlow =
OIDAuthState.authState(byPresenting: request, presenting: self)
It fails when passing my view controller as presenting self since it is not inherited by an ’’’extension AppAuthExampleViewController: OIDAuthStateChangeDelegate, OIDAuthStateErrorDelegate’’’ which however is not allowed by the view to inherit. This is where I am stuck.
Is there a trick or another solution for swiftui with oauth2 and not wrapping swift/storyboard based authentication projects and still managing user tokens/log in credentials? Currently, I’m slightly brain afk.