Skip to content

Commit 02e87b0

Browse files
committed
Improve client credentials sample
- Reword a passage in the README for improved clarity - Adjust whitespace in various files
1 parent 8b1f741 commit 02e87b0

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Base Url endpoint
2-
BASE_URL='https://api-sandbox.uphold.com'
2+
BASE_URL = 'https://api-sandbox.uphold.com'
33

44
CLIENT_ID = ''
55
CLIENT_SECRET = ''

rest-api/javascript/authentication/client-credential-flow/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Client credentials flow
22

3-
This sample project demonstrates how to authenticate in the Uphold API using the client credentials flow. For further background, please refer to the [API documentation](https://uphold.com/en/developer/api/documentation).
3+
This sample project demonstrates how to authenticate in the Uphold API using the [OAuth 2.0 client credentials](https://www.oauth.com/oauth2-servers/access-tokens/client-credentials/) flow.
4+
For further background, please refer to the [API documentation](https://uphold.com/en/developer/api/documentation).
45

56
## Summary
67

@@ -13,7 +14,7 @@ This sample project performs the following actions:
1314

1415
**Important notice:** In Uphold's production environment, client credentials authentication is only available for **business accounts**, and requires manual approval from Uphold.
1516
Please [contact Uphold](mailto:developer@uphold.com) to obtain this permission.
16-
For applications that use the sandbox environment, as is the case with this demo project, those requirements can be skipped.
17+
For requests made in the sandbox environment, as is the case with this demo project, those requirements can be skipped.
1718

1819
## Requirements
1920

rest-api/javascript/authentication/client-credential-flow/cc-flow.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ const { encode } = b64Pkg;
1212
/**
1313
* Dotenv configuration.
1414
*/
15+
1516
dotenv.config({ path: path.resolve() + "/.env" });
1617

1718
/**
1819
* Get Token.
1920
*/
21+
2022
export async function getToken() {
2123
// Base64-encoded authentication credentials
2224
const auth = encode(process.env.CLIENT_ID + ":" + process.env.CLIENT_SECRET);
@@ -49,6 +51,7 @@ export async function getToken() {
4951
/**
5052
* Get assets.
5153
*/
54+
5255
export async function getAssets(token) {
5356
try {
5457
const response = await axios.get(`${process.env.BASE_URL}/v0/assets`, {

0 commit comments

Comments
 (0)