-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
authorize callback not called #15
Comments
@natecraft1 Thanks for filing this issue. This certainly sounds like an issue with your redirect URI as I cannot reproduce it on my end. The browser used is not configurable as this is handled by AppAuth afaik. Let me know if you need further assistance and if so please provide a reproduction of the issue that I can look at, thanks! |
@natecraft1 Did you manage to solve this issue in the end? I've been experiencing the same issue. Callback is never called. |
I did - it was a while ago. I think it was a code issue. I dug into the example project on this repo and found I was missing some code (it should probably be in the readme) Make sure you have this below and let me know if that solves it. class AppDelegate: NSObject, NSApplicationDelegate {
var window: NSWindow!
func applicationDidFinishLaunching(_ aNotification: Notification) {
FirebaseApp.configure()
// Handle URL event
NSAppleEventManager.shared().setEventHandler(self, andSelector: #selector(handleEvent(event:replyEvent:)), forEventClass: AEEventClass(kInternetEventClass), andEventID: AEEventID(kAEGetURL))
GAppAuth.shared.appendAuthorizationRealm(OIDScopeEmail)
// Retrieve existing auth
GAppAuth.shared.retrieveExistingAuthorizationState()
}
func applicationWillTerminate(_ aNotification: Notification) {
// Insert code here to tear down your application
}
@objc private func handleEvent(event: NSAppleEventDescriptor, replyEvent: NSAppleEventDescriptor) {
let urlString = event.paramDescriptor(forKeyword: keyDirectObject)?.stringValue ?? ""
let url = URL(string: urlString)!
_ = GAppAuth.shared.continueAuthorization(with: url, callback: nil)
}
} |
In my ViewController:
What happens is that it pops Safari, and when I sign in with my email, it just lands me on google.com and the callback is not called. Could it be an issue with the redirect URI? Also, why it doesn't use the default browser? Is that configurable?
Thanks!
The text was updated successfully, but these errors were encountered: