Skip to content

Commit

Permalink
BCDA-7198: Fix curl instructions for retrieving sandbox tokens (#174)
Browse files Browse the repository at this point in the history
## 🎫 Ticket

https://jira.cms.gov/browse/BCDA-7198

## 🛠 Changes

- Update URL in instructions to point to `/auth/token`
- Update bearer string in instructions to match the client ID/secret in
Option 2

## ℹ️ Context for reviewers

Noticed that these instructions are a little inaccurate and don't
actually work. They should be updated so folks can successfully retrieve
short-lived tokens in sandbox.

## ✅ Acceptance Validation

Validated by running the new cURL command locally.

## 🔒 Security Implications

- [ ] This PR adds a new software dependency or dependencies.
- [ ] This PR modifies or invalidates one or more of our security
controls.
- [ ] This PR stores or transmits data that was not stored or
transmitted before.
- [ ] This PR requires additional review of its security implications
for other reasons.
  • Loading branch information
kyeah committed Jun 23, 2023
1 parent 78fc903 commit deac763
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
6 changes: 3 additions & 3 deletions _includes/build/access_token.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ <h4>
<p>
cURL Option 1: This cURL command requires separate base-64 encryption. We have concatenated the base64 encoding of the ‘Client ID : Secret’ as the argument to the -H flag. Please note that the URL in the Production environment will be different.
</p>
<pre><code>curl -d '' -X POST 'https://sandbox.bcda.cms.gov/ ' \
-H "accept: application/json" \
-H "authorization: Basic Mzg0MWM1OTQtYThjMC00MWU1Tk4Y2MtMzhiYjQ1MzYwZDNjOmY5NzgwZDMyMzU4OGYxY2RmYzNlNjNlOTVhOGNiZGNkZDQ3NjAyZmY0OGE1MzdiNTFkYzVkNzgzNGJmNDY2NDE2YTcxNmJkNDUwOGU5MDRh"</code></pre>
<pre><code>curl -d '' -X POST 'https://sandbox.bcda.cms.gov/auth/token' \
-H "accept: application/json" \
-H "authorization: Basic MjQ2MmM5NmItNjQyNy00ZWZiLWFlZDctMTE4ZTIwYzJlOTk3OjhlODdmMGViYzUwZDEwZjFiYzk3MzQzMjlhOTkwMDE3OWI4NGNjZDM5ZTRkMDkyMGI5MDVjYzM1OWNmNmU5NGE2ZTc2MGJiZTNhMDg5MGM3"</code></pre>

<p>
cURL Option 2: This cURL command encrypts your credentials with base-64 encryption
Expand Down
10 changes: 6 additions & 4 deletions _includes/build/bcda_v2.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@ <h2>
</tr>
<tr>
<td>
<code>curl -X GET 'https://api.bcda.cms.gov/api/v1/Patient/$export' \
-H "accept: application/fhir+json" \ -H "Prefer: respond-async" \
<code>curl -X GET 'https://api.bcda.cms.gov/api/v1/Patient/$export' \
-H "accept: application/fhir+json" \
-H "Prefer: respond-async" \
-H "Authorization: Bearer {access_token}"</code>
</td>
<td>
<code>curl -X GET 'https://api.bcda.cms.gov/api/v2/Patient/$export' \
-H "accept: application/fhir+json" \ -H "Prefer: respond-async" \
<code>curl -X GET 'https://api.bcda.cms.gov/api/v2/Patient/$export' \
-H "accept: application/fhir+json" \
-H "Prefer: respond-async" \
-H "Authorization: Bearer {access_token}"</code>
</td>
</tr>
Expand Down
14 changes: 7 additions & 7 deletions _includes/guide/bcda_v2.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ <h2>
</tr>
<tr>
<td>
<code>curl -X GET 'https://sandbox.bcda.cms.gov/api/v1/Patient/$export' \
-H "accept: application/fhir+json" \
-H "Prefer: respond-async" \
<code>curl -X GET 'https://sandbox.bcda.cms.gov/api/v1/Patient/$export' \
-H "accept: application/fhir+json" \
-H "Prefer: respond-async" \
-H "Authorization: Bearer {access_token}"</code>
</td>
<td>
<code>curl -X GET 'https://sandbox.bcda.cms.gov/api/v2/Patient/$export' \
-H "accept: application/fhir+json" \
-H "Prefer: respond-async" \
<code>curl -X GET 'https://sandbox.bcda.cms.gov/api/v2/Patient/$export' \
-H "accept: application/fhir+json" \
-H "Prefer: respond-async" \
-H "Authorization: Bearer {access_token}"</code>
</td>
</tr>
</table>
</div>
</p>
</p>

0 comments on commit deac763

Please sign in to comment.