smart-on-fhir / Swift-SMART

Swift SMART on FHIR framework for iOS and OS X

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AppDelegate to handle OAuth Redirect in an OSX app

johncneal opened this issue · comments

I hope this is an appropriate place to raise this issue.

I'm trying to build an OSX app using the Swift-SMART framework but I'm struggling to understand what I need to put in the AppDelegate to handle the OAuth Redirect. The sample app is for iOS but OSX would appear to require different code in the AppDelegate to intercept and manage the redirect.

Putting the URL Scheme in the plist is straightforward enough but the OSX app uses the NSApplicationDelegate protocol which supports different function implementations to UIApplicationDelegate. Is anyone able to provide a suitable AppDelegate for use with OSX apps which use the Swift-SMART framework?

Finally, I assume what is required in the AppDelegate differs depending on whether the OS browser (Safari) is used or the 'embedded' browser - if so, how does it differ?

John N

Yes, perfectly fine place to ask!

We use the OAuth2 submodule for the OAuth2 flow, you can find some more details on the redirect on its README page. Does this help?

Thank you Pascal - the OSX sample app helped a lot and I've managed to authenticate to Cerners sandbox. Needless to say a few further issues as I go forward to query the resources (http 403 doing a Search) which I'm just investigating.
john n

Great, let me know how it goes, haven't tried myself.