Closed devjamie closed 7 years ago
Which version/release are you using? Please set the "verbose": true
flag in the settings dict as well and post the log.
Ok I got farther, but I am now not seeing a patient in smart.authorize... thanks!
testSomeClasses [Debug] SMART: Initialized SMART on FHIR client against server https://fhir-api-dstu2.smarthealthit.org/ testSomeClasses 2 testSomeClasses 3 [Debug] SMART: ---> GET https://fhir-api-dstu2.smarthealthit.org/metadata?_summary=true [Debug] SMART: <--- 200 (404902 Byte) [Debug] SMART: Server supports REST security via “OAuth2 using SMART-on-FHIR profile (see http://docs.smarthealthit.org)” [Debug] OAuth2: Looking for items in keychain [Debug] OAuth2: Found client id [Debug] OAuth2: Initialization finished [Debug] SMART: Initialized server auth of type “authorization_code” [Debug] OAuth2: No access token, maybe I can refresh [Debug] OAuth2: I don't have a refresh token, not trying to refresh [Debug] OAuth2: Opening authorize URL in embedded Safari: https://authorize-dstu2.smarthealthit.org/authorize?client_id=a1c30470-2e49-4ca1-b0b8-a35133a9b1c8&redirect_uri=smartapp%3A%2F%2Fcallback&scope=user%2F*.*+openid+profile&response_type=code&aud=https%3A%2F%2Ffhir-api-dstu2.smarthealthit.org&state=E56338C4 smartapp://callback?code=zq8tcU&state=E56338C4
I have pushed a lot of updates:
master
is now on Swift 3 and DSTU-22.3.0
is on Swift 2.3 and DSTU-2develop
is on Swift 3 and STU-3 v1.6How do those work for you now?
Arg looks like I haven't pushed develop
from my home machine. Will do later today. 😬
Ha! k thx :) 👍
You can use master
in the meantime for DSTU-2 data. I've tried to minimize braking changes between master
and develop
(aside from the data models, obviously).
K let you know how it goes :)
👍🏼
Turns out I hadn't actually updated Swift-SMART's develop
branch. Now everything seems in order:
master
is Swift 3 + DSTU-2 (v1.0.2)develop
is Swift 3 + STU-3 ballot (v1.6)Hope it works for you!
same issue i am facing. Suggest any changes if need to do?
Console
[Debug] SMART: Initialized SMART on FHIR client against server https://fhir-api-dstu2.smarthealthit.org/ [Debug] SMART: ---> Optional("GET") https://fhir-api-dstu2.smarthealthit.org/metadata?_summary=true [Debug] SMART: <--- 200 (404902 Byte) [Debug] SMART: Server supports REST security via “OAuth2 using SMART-on-FHIR profile (see http://docs.smarthealthit.org)” [Debug] OAuth2: Initialization finished [Debug] OAuth2: Looking for items in keychain [Debug] OAuth2: Found client id [Debug] SMART: Initialized server auth of type “authorization_code” [Debug] OAuth2: Starting authorization [Debug] OAuth2: No access token, checking if a refresh token is available [Debug] OAuth2: I don't have a refresh token, not trying to refresh [Debug] OAuth2: Opening authorize URL embedded: https://authorize-dstu2.smarthealthit.org/authorize?redirect_uri=smartapp%3A%2F%2Fcallback&client_id=0848dec1-8b5b-4698-bb39-b2bf02c33f9e&response_type=code&aud=https%3A%2F%2Ffhir-api-dstu2.smarthealthit.org&scope=user%2F*.*+openid+profile&state=00EBC8D7
If MEDS application is installed then shows :-
if no meds application then:-
Yes, this is correct, it will redirect to the "redirect" URL that you have specified in the settings dict. Have you registered that URL scheme in your app?
No i am using demo URL
I see I need to clarify the README once back from vacation. Until then please see https://github.com/smart-on-fhir/SoF-MedList/blob/master/SoF-MedList/AppDelegate.swift (last method) on how to intercept the redirect, and register the redirect URL scheme for your app; see the sample app (Info.plist).
Thanks a lot It works i missed that
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
if smart.awaitingAuthCallback {
return smart.didRedirect(to: url)
}
return false
}
to implement so its not redirecting now its working good
Thanks a lot Can you guide for refresh token. How to reconnect with refresh token Without visiting safari...
On Jan 5, 2017 5:31 AM, "Pascal Pfiffner" notifications@github.com wrote:
Closed #3 https://github.com/smart-on-fhir/Swift-SMART/issues/3 via b5c3d03 https://github.com/smart-on-fhir/Swift-SMART/commit/b5c3d034bddd5b3e02a1d2c33c4b8472a5b495b4 .
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/smart-on-fhir/Swift-SMART/issues/3#event-911990449, or mute the thread https://github.com/notifications/unsubscribe-auth/ARbzYkWCgTBCf0wCruTyRLdlx8JumhiXks5rPDL1gaJpZM4J9Nqe .
The OAuth2 library that's included in this framework will do this automatically when you use the authorize
call. It will:
Details here: https://github.com/p2/OAuth2/wiki/Call-Graph
There currently is no way to suppress the login screen, maybe this is something to take a closer look.
Whenever I try to authorize it's giving me an invalid address error.
Here is my func
func testSomeClasses(){ print("testSomeClasses") let smart = Client( baseURL: "https://fhir-api-dstu2.smarthealthit.org", settings: [ //"client_id": "my_mobile_app", "redirect": "smartapp://callback", // must be registered ] ) print("testSomeClasses 2") smart.authProperties.embedded = true smart.authProperties.granularity = .TokenOnly // same with .PatientSelectNative print("testSomeClasses 3") smart.authorize() { patient, error in print("testSomeClasses 4") if let error = error { // there was an error print("testSomeClasses error ", error) } else { print("hello") print(patient?.name) //
patient
is a "Patient" resource on success, unless you've used // theTokenOnly
granularity } }Console prints: testSomeClasses testSomeClasses 2 testSomeClasses 3