Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Why this is required

  • This one off process is done in order to ensure the user of the application is linked to their record in PKB and avoid the need for them to grant the application access to their PKB record every time they want to use it.

  • This process allows the app to determine the patient’s demographics, including identifiers stored within PKB, enabling further interaction with PKB’s APIs for that patient.

How to:

Account Creation

  • The patient already has a PKB record they can access.

  • Patient creates an account on the partner app.

  • The app ensures the patient login is associated with a unique app_user_id.

Initiating OAuth 2.0 Grant Access

  • From an appropriate screen in the app, the patient is given a link to the PKB “grant access” OAuth2.0 screens.

Authorization Code Grant Workflow

  • Patient grants access using OAuth 2.0.

image-20241125-165144.png

Authorization Code Retrieval

  • Following a successful login, PKB will return an authorization code to the app via the redirect URL provided by the app.

image-20241125-165310.png

Token Exchange & Token Management

  • The app exchanges the authorization code for an access and refresh token which enable interaction with the PKB APIs specifically for that patient.  

    • Using the authorization code as a parameter, you’ll swap it for an access / refresh token pair.

    • Further details with parameters and example call and response are here.

    • The patient will only do this authorization one time.

    • The app will need to maintain, manage, and associate tokens with the corresponding patient record in the app.

Patient Detail Retrieval

  • Using a valid access token, the partner app pulls the patient’s details. There are a few options, two of which are outlined below, and the best option depends on what the partner use case is.

  • No labels