Skip to content

Commit

Permalink
add README and modify payer scope handling of 'initialize_state'
Browse files Browse the repository at this point in the history
  • Loading branch information
nlaanait committed Jun 3, 2023
1 parent b7fae1a commit 8174ef0
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# patient-access-api
A lightweight backend server with handlers to:
1. Perform oauth2 pkce authorization flow
2. Implements redirection to authenticate a user with a payer's application and access token trading.
3. Basic requests to query data for the authenticated user.

## Dependencies
- Register as a developer with a Payer (e.g. developer.cigna.com)
- Sign up for an ngrok account to get a custom subdomain name

## Usage
Populate a `config.toml`, using the following template:
```toml
[cigna_sandbox]
client_id=""
token_url=""
auth_url=""
api_scopes=["write", "read"]
redirect_url="<the callback url you registered with cigna>"

[cigna_prod]
[cigna_sandbox]
client_id=""
token_url=""
auth_url=""
api_scopes=["write", "read"]
redirect_url="<the callback url you registered with cigna>"

[ngrok_config]
auth_token=""
tunnel_url="<your custom ngrok url>"
```
Build :
```bash
cargo build --release
```
Execute to launch the server:

```bash
$ target/release/patient_access_api --config <path-to-your-config.toml>
```

If successfully launched you should see:
```
2023-06-03T16:40:51.754303Z INFO patient_access_api::settings: Configuring Payer Environment to: <payer-environment>
2023-06-03T16:40:52.728791Z INFO patient_access_api: Starting Server...
2023-06-03T16:40:52.728865Z INFO patient_access_api: Serving on <ngrok-tunnel-url>
```
For help:
```
$ patient_access_api --help
```

If the server is successfully launched, visit `<ngrok-tunnel-url>`.
To trigger a patient authentication go to: `<ngrok-tunnel-url>/authz`

0 comments on commit 8174ef0

Please sign in to comment.