I have configured an OAuth2/openID server in Azure Active Directory that I am using to authenticate users for the purpose of accessing a third party application. The app will then open in a 'patient context' meaning some information about a patient will be displayed.
I need to be able to pass a PatientId from the point where I call the third party URL to where the ~/v2.0/token returns the JSON response. The third party requires that the PatientId be included as an element in the token response eg.:
{
"access_token":"the access token...",
"token_type":"bearer",
"expires_in":"3600",
"scope":"patient/patient.read",
"id_token":"the user id token ....",
"patient":"123456"
}
How can I persist this PatientId until it can be added to the token response? I cannot see any parameter in the ~/v2.0/token request that I can use to link the requested PatientId with the current authentication flow.