Skip to content

Commit cf89e59

Browse files
committed
updating default audeince config values and logic
1 parent 09d96fb commit cf89e59

File tree

9 files changed

+17
-13
lines changed

9 files changed

+17
-13
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ This can be done by renaming `auth_config.json.example` (https://github.com/auth
3535
"domain": "YOUR_DOMAIN",
3636
"clientId": "YOUR_CLIENT_ID",
3737
"authorizationParams": {
38-
"audience": "YOUR_API_IDENTIFIER",
38+
"audience": "{yourApiIdentifier}",
3939
},
4040
"apiUri": "http://localhost:3001",
4141
"appUri": "http://localhost:4200"

Sample-01/api-server.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ const app = express();
1010
if (
1111
!authConfig.domain ||
1212
!authConfig.authorizationParams.audience ||
13-
["YOUR_API_IDENTIFIER", "{API_IDENTIFIER}"].includes(authConfig.authorizationParams.audience)
13+
['{yourApiIdentifier}', '{API_IDENTIFIER}'].includes(
14+
authConfig.authorizationParams.audience
15+
)
1416
) {
1517
console.log(
16-
"Exiting: Please make sure that auth_config.json is in place and populated with valid domain and audience values"
18+
'Exiting: Please make sure that auth_config.json is in place and populated with valid domain and audience values'
1719
);
1820

1921
process.exit();

Sample-01/src/app/pages/external-api/external-api.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div class="container mt-5">
22
<h1>External API</h1>
3-
3+
44
<div *ngIf="hasApiError" class="alert alert-danger" role="alert">
55
An error occured when trying to call the local API on port 3001. Ensure the local API is started using either `npm run dev` or `npm run
66
server:api`.
@@ -20,7 +20,7 @@ <h1>External API</h1>
2020
<p>
2121
You can't call the API at the moment because your application does not
2222
have any configuration for <code>audience</code>, or it is using the
23-
default value of <code>YOUR_API_IDENTIFIER</code>. You might get this
23+
default value of <code>&#123;yourApiIdentifier&#125;</code>. You might get this
2424
default value if you used the "Download Sample" feature of
2525
<a href="https://auth0.com/docs/quickstart/spa/angular">
2626
the quickstart guide </a

Sample-01/src/environments/environment.prod.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const environment = {
1313
auth: {
1414
domain,
1515
clientId,
16-
...(audience && audience !== "YOUR_API_IDENTIFIER" ? { audience } : null),
16+
...(audience && audience !== "{yourApiIdentifier}" ? { audience } : null),
1717
redirectUri: window.location.origin,
1818
errorPath,
1919
},

Sample-01/src/environments/environment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const environment = {
1919
domain,
2020
clientId,
2121
authorizationParams: {
22-
...(audience && audience !== 'YOUR_API_IDENTIFIER' ? { audience } : null),
22+
...(audience && audience !== '{yourApiIdentifier}' ? { audience } : null),
2323
redirect_uri: window.location.origin,
2424
},
2525
errorPath,

Standalone/api-server.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ const app = express();
1010
if (
1111
!authConfig.domain ||
1212
!authConfig.authorizationParams.audience ||
13-
["YOUR_API_IDENTIFIER", "{API_IDENTIFIER}"].includes(authConfig.authorizationParams.audience)
13+
['{yourApiIdentifier}', '{API_IDENTIFIER}'].includes(
14+
authConfig.authorizationParams.audience
15+
)
1416
) {
1517
console.log(
16-
"Exiting: Please make sure that auth_config.json is in place and populated with valid domain and audience values"
18+
'Exiting: Please make sure that auth_config.json is in place and populated with valid domain and audience values'
1719
);
1820

1921
process.exit();

Standalone/src/app/pages/external-api/external-api.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div class="container mt-5">
22
<h1>External API</h1>
3-
3+
44
<div *ngIf="hasApiError" class="alert alert-danger" role="alert">
55
An error occured when trying to call the local API on port 3001. Ensure the local API is started using either `npm run dev` or `npm run
66
server:api`.
@@ -20,7 +20,7 @@ <h1>External API</h1>
2020
<p>
2121
You can't call the API at the moment because your application does not
2222
have any configuration for <code>audience</code>, or it is using the
23-
default value of <code>YOUR_API_IDENTIFIER</code>. You might get this
23+
default value of <code>&#123;yourApiIdentifier&#125;</code>. You might get this
2424
default value if you used the "Download Sample" feature of
2525
<a href="https://auth0.com/docs/quickstart/spa/angular">
2626
the quickstart guide </a

Standalone/src/environments/environment.prod.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const environment = {
1313
auth: {
1414
domain,
1515
clientId,
16-
...(audience && audience !== "YOUR_API_IDENTIFIER" ? { audience } : null),
16+
...(audience && audience !== "{yourApiIdentifier}" ? { audience } : null),
1717
redirectUri: window.location.origin,
1818
errorPath,
1919
},

Standalone/src/environments/environment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const environment = {
1919
domain,
2020
clientId,
2121
authorizationParams: {
22-
...(audience && audience !== 'YOUR_API_IDENTIFIER' ? { audience } : null),
22+
...(audience && audience !== '{yourApiIdentifier}' ? { audience } : null),
2323
redirect_uri: window.location.origin,
2424
},
2525
errorPath,

0 commit comments

Comments
 (0)