Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

`APP_SECRET`
`END_USER_AUTH_JWT_SECRET`

`WEBCHAT_SECRET`

Expand Down
12 changes: 6 additions & 6 deletions azuredeploy.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@
"description": "Location for all resources."
}
},
"appSecret": {
"endUserAuthJwtSecret": {
"type": "securestring",
"metadata":{
"description": "Healthbot application secret."
"description": "Healthbot end user authentication JWT secret."
}
},
"webchatSecret": {
Expand Down Expand Up @@ -109,8 +109,8 @@
"alwaysOn": "[variables('alwaysOn')]",
"appSettings": [
{
"name": "APP_SECRET",
"value": "[parameters('appSecret')]"
"name": "END_USER_AUTH_JWT_SECRET",
"value": "[parameters('endUserAuthJwtSecret')]"
},
{
"name": "WEBCHAT_SECRET",
Expand Down Expand Up @@ -170,8 +170,8 @@
"siteConfig": {
"appSettings": [
{
"name": "APP_SECRET",
"value": "[parameters('appSecret')]"
"name": "END_USER_AUTH_JWT_SECRET",
"value": "[parameters('endUserAuthJwtSecret')]"
},
{
"name": "WEBCHAT_SECRET",
Expand Down
4 changes: 2 additions & 2 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 APP_SECRET = process.env.APP_SECRET;
const END_USER_AUTH_JWT_SECRET = process.env.END_USER_AUTH_JWT_SECRET
const directLineTokenEp = `https://${DIRECTLINE_ENDPOINT_URI || "directline.botframework.com"}/v3/directline/tokens/generate`;

// Initialize the web app instance,
Expand Down Expand Up @@ -111,7 +111,7 @@ app.post('/chatBot', async function(req, res) {
response['isAgent'] = true;
}
response['directLineURI'] = DIRECTLINE_ENDPOINT_URI;
const jwtToken = jwt.sign(response, APP_SECRET);
const jwtToken = jwt.sign(response, END_USER_AUTH_JWT_SECRET);
res.send(jwtToken);
}
catch (err) {
Expand Down