@@ -433,10 +433,20 @@ Example for xsuaa based CDS auth strategy:
433433
434434Headers of Websocket Upgrade request can be accessed via ` req.http.req.headers ` in websocket service handlers.
435435
436- #### Local Development Authorization
436+ #### Local Development
437437
438- For local development, authentication is skipped for authentication kind ` mocked ` . First mocked user (of ` cds.requires.auth.users ` )
439- is taken as authenticated user for websocket connection (e.g. ` alice ` ) in local development setup.
438+ For local development, authentication is skipped for authentication kind ` mocked ` and ` basic ` .
439+ If login is required (` cds.requires.auth.login_required: true ` ), first mocked user (see ` cds.requires.auth.users ` )
440+ is taken as authenticated user for websocket connection (e.g. ` alice ` ),
441+ otherwise the websocket connection is established with an anonymous user.
442+
443+ Using authentication kind ` basic ` or ` cds.requires.auth.login_required: true ` is not recommended for local development,
444+ as the websocket connection is established via WebSocket Upgrade request, which does not support interactive login.
445+ Nevertheless, it could be simulated by hardcoding an authentication cookie in browser as follows:
446+
447+ ``` js
448+ document .cookie = " X-Authorization=Basic YWxpY2U6YWxpY2U; path=/" ; // mock auth for alice
449+ ```
440450
441451### Invocation Context
442452
@@ -1234,19 +1244,23 @@ Modeled action parameters `context`, `exit` and `reset` are mapped from `pcp` me
12341244#### Event-Driven Side Effects
12351245
12361246PCP format can be used to emit Fiori Elements Event-Driven Side Effects via WebSocket events.
1247+ Websocket kind `ws` must be configured (default), as UI5 only supports WebSocket protocol for Fiori Elements side effects.
12371248
12381249First OData V4 service metadata is extended for side effects to automatically connect to the corresponding websocket endpoint and channel:
12391250
12401251```cds
12411252@Common : {
1242- WebSocketBaseURL : ' / ws/ fiori' ,
1253+ WebSocketBaseURL : ' ws/ fiori' ,
12431254 WebSocketChannel #sideEffects: ' sideeffects'
12441255}
12451256service FioriService {
12461257 ...
12471258}
12481259```
12491260
1261+ Path of `WebSocketBaseURL` shall be defined relatively (i.e. no leading slash) to the OData service URL,
1262+ to be correctly resolved in Fiori Elements, especially in context of WorkZone.
1263+
12501264Event-driven side effects are configured in PCP format enabled service via the following annotations:
12511265
12521266- **Event level**:
@@ -1271,7 +1285,7 @@ Example:
12711285
12721286```cds
12731287@Common: {
1274- WebSocketBaseURL: ' / ws/ fiori' ,
1288+ WebSocketBaseURL: ' ws/ fiori' ,
12751289 WebSocketChannel #sideEffects: ' sideeffects' ,
12761290}
12771291service FioriService {
0 commit comments