diff --git a/README.md b/README.md index ed719a7..f5bcf54 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ A simple web page that allows users to communicate with the [Azure Health Bot](h 2.Set the following environment variables: -`END_USER_AUTH_JWT_SECRET` +`AUTH_JWT_SECRET` `WEBCHAT_SECRET` diff --git a/azuredeploy.json b/azuredeploy.json index 1eb5203..3fa7836 100644 --- a/azuredeploy.json +++ b/azuredeploy.json @@ -47,7 +47,7 @@ "description": "Location for all resources." } }, - "endUserAuthJwtSecret": { + "authJwtSecret": { "type": "securestring", "metadata":{ "description": "Healthbot end user authentication JWT secret." @@ -109,8 +109,8 @@ "alwaysOn": "[variables('alwaysOn')]", "appSettings": [ { - "name": "END_USER_AUTH_JWT_SECRET", - "value": "[parameters('endUserAuthJwtSecret')]" + "name": "AUTH_JWT_SECRET", + "value": "[parameters('authJwtSecret')]" }, { "name": "WEBCHAT_SECRET", @@ -170,8 +170,8 @@ "siteConfig": { "appSettings": [ { - "name": "END_USER_AUTH_JWT_SECRET", - "value": "[parameters('endUserAuthJwtSecret')]" + "name": "AUTH_JWT_SECRET", + "value": "[parameters('authJwtSecret')]" }, { "name": "WEBCHAT_SECRET", diff --git a/secrets.png b/secrets.png index e4d0fb3..ac0a8f0 100644 Binary files a/secrets.png and b/secrets.png differ diff --git a/server.js b/server.js index 93c1759..1d68516 100644 --- a/server.js +++ b/server.js @@ -7,7 +7,7 @@ const fetch = require('node-fetch'); const cookieParser = require('cookie-parser'); const WEBCHAT_SECRET = process.env.WEBCHAT_SECRET; const DIRECTLINE_ENDPOINT_URI = process.env.DIRECTLINE_ENDPOINT_URI; -const END_USER_AUTH_JWT_SECRET = process.env.END_USER_AUTH_JWT_SECRET +const AUTH_JWT_SECRET = process.env.AUTH_JWT_SECRET const directLineTokenEp = `https://${DIRECTLINE_ENDPOINT_URI || "directline.botframework.com"}/v3/directline/tokens/generate`; // Initialize the web app instance, @@ -111,7 +111,7 @@ app.post('/chatBot', async function(req, res) { response['isAgent'] = true; } response['directLineURI'] = DIRECTLINE_ENDPOINT_URI; - const jwtToken = jwt.sign(response, END_USER_AUTH_JWT_SECRET); + const jwtToken = jwt.sign(response, AUTH_JWT_SECRET); res.send(jwtToken); } catch (err) {