layout | title |
---|---|
main |
FAQ |
When writing a SMART app, you can get information about the logged in user by requesting the oauth scopes openid
and profile
in addition to any other scopes your app needs. This will give your app an id_token
property in the access token response (see bottom of Scope Documentation for details on how to process it). If you're using our Javascript client library, you can just do:
smart.user.read().then(function(user){
console.log("User is a " + user.resourceType + " with id " + user.id);
})
The user
object will be either a Patient, a Practitioner, or a RelatedPerson. Note that in our sandbox right now we always pretend that the user is Practitioner/123
- this obeys the formal specification, so you can test your app and ensure you're handling tokens correctly.