You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -283,7 +283,7 @@ Notes: web developers are advised to use [`~` (tilde range)](https://github.com/
283
283
284
284
### Samples
285
285
286
-
- Sample `01.getting-started/l.sharepoint-web-part`and samples under `07.advanced-web-chat-apps` is being archived and will no longer receive updates, in PR [#5533](https://github.com/microsoft/BotFramework-WebChat/pull/5533), by [@compulim](https://github.com/compulim)
286
+
- Sample `01.getting-started/l.sharepoint-web-part`, `01.getting-started/k.direct-line-token`, and samples under `07.advanced-web-chat-apps` is being archived and will no longer receive updates, in PR [#5533](https://github.com/microsoft/BotFramework-WebChat/pull/5533), [#5536](https://github.com/microsoft/BotFramework-WebChat/pull/5536), and [#5537](https://github.com/microsoft/BotFramework-WebChat/pull/5537), by [@compulim](https://github.com/compulim)
1. Save the Web Chat secret to `/web/appsettings.json`
65
-
- ```
66
-
"DirectLineSecret": "<your-direct-line-secret>"
67
-
```
67
+
- ```
68
+
"DirectLineSecret": "<your-direct-line-secret>"
69
+
```
68
70
69
71
</details>
70
72
71
73
During development, you will run your bot locally. Azure Bot Services will send activities to your bot thru a public URL. You can use [ngrok](https://ngrok.com/) to expose your bot server on a public URL.
72
74
73
75
1. Run `ngrok http -host-header=localhost:3978 3978`
74
76
1. Update your Bot Channel Registration. You can use [Azure CLI](https://aka.ms/az-cli) or [Azure Portal](https://portal.azure.com)
- In "Configuration" section, set "Messaging Endpoint" to `https://a1b2c3d4.ngrok.io/api/messages`
81
83
82
84
## Prepare and run the code
83
85
84
86
1. Under each of `bot`, and `web` folder, run the following commands, depending on your language:
85
87
86
88
<details><summary>JavaScript</summary>
87
-
88
89
1. `npm install`
89
90
1. `npm start`
90
91
91
92
</details>
92
93
93
94
<details><summary>C#</summary>
94
-
95
95
1. `dotnet build`
96
96
1. `dotnet run`
97
97
@@ -101,18 +101,18 @@ During development, you will run your bot locally. Azure Bot Services will send
101
101
102
102
# Things to try out
103
103
104
-
- Type anything to the bot. It should reply with your user ID, which will stay the same for the duration of the session.
105
-
- Open a new browser tab to http://localhost:5000 and type anything to the bot. It should reply with a different user ID since it has generated a different Direct Line token.
104
+
- Type anything to the bot. It should reply with your user ID, which will stay the same for the duration of the session.
105
+
- Open a new browser tab to http://localhost:5000 and type anything to the bot. It should reply with a different user ID since it has generated a different Direct Line token.
106
106
107
107
# Code
108
108
109
109
The code is organized into two separate folders:
110
110
111
-
- `/bot/` is the bot server
112
-
- `/web/` is the REST API for generating Direct Line tokens
113
-
- `GET /api/directline/token` will generate a new Direct Line token for the app. The token will be bound to a random user ID.
114
-
- During development-time, it will also serve the bot server via `/api/messages/`
115
-
- To enable this feature, add `PROXY_BOT_URL=http://localhost:3978` to `/web/.env`
111
+
- `/bot/` is the bot server
112
+
- `/web/` is the REST API for generating Direct Line tokens
113
+
- `GET /api/directline/token` will generate a new Direct Line token for the app. The token will be bound to a random user ID.
114
+
- During development-time, it will also serve the bot server via `/api/messages/`
115
+
- To enable this feature, add `PROXY_BOT_URL=http://localhost:3978` to `/web/.env`
116
116
117
117
## Constructing the user ID
118
118
@@ -246,9 +246,9 @@ Note that we do _not_ specify a user ID when initiating Web Chat. Direct Line wi
246
246
247
247
This sample includes multiple parts:
248
248
249
-
-**The UI** is a static HTML/JS web page with Web Chat integrated via JavaScript bundle. It makes a POST request to the backend API and uses the resulting Direct Line token to render Web Chat.
250
-
-**The backend API** generates Direct Line tokens. Each generated token is bound to a new, randomly-generated user ID.
251
-
-**The bot** is a bare-bones bot that responds to every message by sending the user's ID.
249
+
-**The UI** is a static HTML/JS web page with Web Chat integrated via JavaScript bundle. It makes a POST request to the backend API and uses the resulting Direct Line token to render Web Chat.
250
+
-**The backend API** generates Direct Line tokens. Each generated token is bound to a new, randomly-generated user ID.
251
+
-**The bot** is a bare-bones bot that responds to every message by sending the user's ID.
252
252
253
253
## Motivation
254
254
@@ -342,6 +342,6 @@ The flow could be:
342
342
343
343
# Further reading
344
344
345
-
-[Create an Azure Bot resource](https://docs.microsoft.com/en-us/azure/bot-service/abs-quickstart?view=azure-bot-service-4.0&tabs=userassigned#create-the-resource)
346
-
-[Generating a Direct Line token](https://docs.microsoft.com/en-us/azure/bot-service/rest-api/bot-framework-rest-direct-line-3-0-authentication?view=azure-bot-service-4.0#generate-token)
347
-
-[Enhanced Direct Line Authentication feature](https://blog.botframework.com/2018/09/25/enhanced-direct-line-authentication-features/)
345
+
-[Create an Azure Bot resource](https://docs.microsoft.com/en-us/azure/bot-service/abs-quickstart?view=azure-bot-service-4.0&tabs=userassigned#create-the-resource)
346
+
-[Generating a Direct Line token](https://docs.microsoft.com/en-us/azure/bot-service/rest-api/bot-framework-rest-direct-line-3-0-authentication?view=azure-bot-service-4.0#generate-token)
347
+
-[Enhanced Direct Line Authentication feature](https://blog.botframework.com/2018/09/25/enhanced-direct-line-authentication-features/)
0 commit comments