Trevor
Trevor

Reputation: 843

Swift ASWebAuthenticationSession callbackURLScheme not calling completion

I am setting up OAuth for Stripe using Swift/SwiftUI, Firebase, and of course, Stripe. How it works is you make some requests to get the Stripe users account ID, then create another request that spits out the OAuth URL. For testing purposes the url looks like this:

https://connect.stripe.com/express/oauth/authorize?redirect_uri=https://www.brandboost.app/auth-completion&client_id=YOURTESTID

Once the auth is complete, Stripe redirects to the given uri. This is very common, but here's where things get weird. As you can see in the auth url above, my uri is a link to a domain I own, but since the URI of a valid domain is http/https. You might be thinking, "just make the URI custom", well you can't.

When adding your custom URI to Stripe, this happens: enter image description here

So you have to use a valid URI, meaning the domain you enter doesn't even exist? What am I supposed to do here?

Also, here is my session & the callbackURLScheme:

let authSession = ASWebAuthenticationSession(url: url, callbackURLScheme: "auth-completion") { (url, error) in
   //
}

I have used callbacks and URIs before, and I cannot figure out how to get it working. Where am I going wrong here?

Upvotes: 0

Views: 184

Answers (0)

Related Questions