Skip to content

Commit

Permalink
updates after run 8 (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
steinsiv authored Apr 4, 2024
1 parent f34dfe6 commit 75282cf
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ex-05/doc/running_the_application.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Steps:
npm start
```

* Open the application in the browser. Remember that the forwarded port needs to be public.
* Open the application in the browser.
* Stop the application and set the NODE_ENV to "development"

```shell
Expand Down
7 changes: 5 additions & 2 deletions ex-09/lib/auth-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ async function requestAccessTokenUsingAuthCode(request, reply, authCode) {
codeVerifier: request.session.pkceCodes.verifier, // PKCE Code Verifier
};

logger.debug('Making token request:');
logger.debug(tokenRequest);

//https://azuread.github.io/microsoft-authentication-library-for-js/ref/classes/_azure_msal_node.confidentialclientapplication.html#acquiretokenbycode

await confidentialClientApplication
Expand Down Expand Up @@ -102,8 +105,8 @@ async function getTokenAuthCode (request, reply) {
authCodeUrlParameters.codeChallengeMethod = request.session.pkceCodes.challengeMethod;
});

logger.debug(request.session.pkceCodes);


logger.debug('PKCE codes used in this session: ' + JSON.stringify(request.session.pkceCodes));

//https://learn.microsoft.com/en-us/javascript/api/%40azure/msal-node/confidentialclientapplication?view=msal-js-latest#@azure-msal-node-confidentialclientapplication-acquiretokenbycode
await confidentialClientApplication
Expand Down
6 changes: 3 additions & 3 deletions ex-10/doc/exploring_the_api_code.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ The api lives in `./ex-10/got-episodes-api`

Steps:

* The Controller (./controller/episodes_controller.js)
* The controller code for the api, adding functions to get all episodes, get one episode, add an episode, update an episode and delete an episode
* The controller reads episodes demo data from './data/got_demo_data'. No data is persisted, it's in memory for this version.
* Server and app code (./src/server.js, ./src/app.js)
* The Server creates an instance of the web app (app.js)
* The app code is the main api server
Expand All @@ -23,6 +20,9 @@ Steps:
* POST - /api/episodes
* PUT - /api/episodes/:id
* DELETE - /api/episodes/:id
* The Controller (./controller/episodes_controller.js)
* The controller code for the api, adding functions to get all episodes, get one episode, add an episode, update an episode and delete an episode
* The controller reads episodes demo data from './data/got_demo_data'. No data is persisted, it's in memory for this version.
* Lib contains helpers (./lib)
* 'app-config.js' to build and validate configuration params
* 'auth.js' to help validating api requests, jwt token and scope vs api verbs
Expand Down
6 changes: 5 additions & 1 deletion ex-11/doc/client_code_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@ Steps:

## The Config

* New environment variables `EPISODES_API_URI` and `EPISODES_API_URL` that needs to be added to then env file
* New environment variables to be added.
* Hint: Microsoft Entra ID -> App Registrations -> Episodes Api -> Expose An Api -> Application ID URI
```sh
export EPISODES_API_URI=
export EPISODES_API_URL=
```
* Update the client env file (appsec-course-client-eq.env)
* Run `aa-save-env-files-to-github-user-secret.sh` in a terminal window to persist the new environment variables (don't __reload__)

Expand Down

0 comments on commit 75282cf

Please sign in to comment.