Closed raheelsayeed closed 6 years ago
Yeah, that's not fully supported. You should use the TokenOnly
auth granularity (see https://github.com/smart-on-fhir/Swift-SMART/wiki/Client#authorization) but then you don't have a way to access the id_token
that tells you which Practitioner
resource to get. Would it work if you expose Client.server.auth.oauth.idToken
on Client.server.idToken
, then in the authorize() callback you can inspect it? If that works, happy to accept a PR!
That sounds better. I was going a long way to NOT have tokens exposed to the client. But then, I like this idea of clients resolving user resource (Patient or Practitioner or ..?) if and when necessary.
// Server.swift
public var idToken : String? {
get { return auth?.oauth?.idToken }
}
// Elsewhere:
client.authorize(callback: { [unowned self] (patient, error) in
if let idToken = self.client.server.idToken {
// resolve User.
}
})
I am working on a standalone Practitioner Login through SMART-on-FHIR.
I was wondering what was the recommended way of a Practitioner user login flow. The SMART.Client Authorization works as expected, I do get the
Patient
as a resource but not thePractitioner
.At the moment I extended
SMART.Server
to support a callback withPatient
andPractitioner
, but that requires some tinkering within this codebase. Is there something I'm missing?