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: docs/authentication.md
+28-10Lines changed: 28 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -10,17 +10,17 @@
10
10
11
11
Generally speaking, the authentication behavior mimicks that of a regular user session: first, the `baseUrl` (from the `wdio.conf.(j|t)s`-file) is opened in the configured browser. Then, the redirect to the Authentication provider is awaited and [the credentials](#credentials) are supplied.
12
12
13
-
BTP-, IAS-, Office365- and custom IdP all supply credentials as a user would, meaning they're literally typed into the respective input fields on each login screen.
13
+
BTP-, IAS-, Office365- and custom IdP all supply credentials as a user would, meaning they're literally typed into the respective input fields on each login screen.
14
14
Basic Authentication prepends username and password in encoded form to the URL, resulting in an `HTTP``GET` in the form of `https://username:[email protected]`.
15
15
16
16
!> Multi-Factor Authentication is not supported as it's nearly impossible to manage any media break (e.g. browser ↔ mobile) in authentication flows out of the box
17
17
18
-
For you as users, authentication is done at design-time, meaning: **by configuration only, not programmatically**.
18
+
For you as users, authentication is done at design-time, meaning: **by configuration only, not programmatically**.
19
19
This especially means that no changes in the test code are needed for using authentication in `wdi5` tests!
20
20
21
21
?> No [skipping of the UI5 injection](configuration#skipinjectui5onstart) is necessary, `wdi5` takes care of the correct order of operation (first authentication, then injecting UI5) itself.
22
22
23
-
!> Credentials can only be supplied via environment variables, not in any configuration file.
23
+
!> Credentials can only be supplied via environment variables, not in any configuration file.
24
24
More on the [how and why below](#credentials):point_down:
25
25
26
26
## Configuration
@@ -127,8 +127,8 @@ The `BTP` authenticator will automatically detect whether the login process is a
127
127
128
128
?> only available in `wdi5` >= 2
129
129
130
-
Using the 'Identity Authentication Service (IAS) Authenticator' in `wdi5` is a subset of the [above BTP Authentication](#sap-cloud-idp-default-btp-identity-provider).
131
-
It takes the same configuration options, plus `disableBiometricAuth` (default: `true`, which you want in almost all cases) and `idpDomain`. The latter is necessary to satisfy cookie conditions in the remote-controlled browser.
130
+
Using the 'Identity Authentication Service (IAS) Authenticator' in `wdi5` is a subset of the [above BTP Authentication](#sap-cloud-idp-default-btp-identity-provider).
131
+
It takes the same configuration options, plus `disableBiometricAuth` (default: `true`, which you want in almost all cases) and `idpDomain`. The latter is necessary to satisfy cookie conditions in the remote-controlled browser.
132
132
Set `idpDomain` to the _domain-only_ part of your IAS tenant URL, e.g. `weiruhg.accounts.ondemand.com`, _omitting_ the protocol prefix (`https://`).
133
133
134
134
!> If `disableBiometricAuth` is set to `true`, `idpDomain` must be set as well!
basicAuthUrls: ["https://your-custom-basic-auth-endpoint"] //> optional: default is the configured `baseUrl`
314
315
}
315
316
}
316
317
```
@@ -325,7 +326,8 @@ capabilities: {
325
326
capabilities: {
326
327
// browserName: "..."
327
328
"wdi5:authentication": {
328
-
provider:"BasicAuth"//> mandatory
329
+
provider:"BasicAuth", //> mandatory
330
+
basicAuthUrls: ["https://your-custom-basic-auth-endpoint"] //> optional: default is the configured `baseUrl`
329
331
}
330
332
}
331
333
},
@@ -334,15 +336,31 @@ capabilities: {
334
336
capabilities: {
335
337
// browserName: "..."
336
338
"wdi5:authentication": {
337
-
provider:"BasicAuth"//> mandatory
339
+
provider:"BasicAuth", //> mandatory
340
+
basicAuthUrls: ["https://your-custom-basic-auth-endpoint"] //> optional: default is the configured `baseUrl`
338
341
}
339
342
}
340
343
}
341
344
}
342
345
```
343
346
347
+
#### CAP Authentication (only during development!)
348
+
During development it is common to use basic authentication to mock users. In contrast to deployed applications we have to authenticate ourself directly to the exposed OData enpoints and not to the application itself. For that reason you have to configure the `basicAuthUrls` which should point to the OData `$metadata`.
If you have multiple OData endpoints you have to declare every single OData endpoint in the `basicAuthUrls` array.
360
+
344
361
<!-- tabs:end -->
345
362
363
+
346
364
## Credentials
347
365
348
366
Exposing credentials in configuration files that were accidentally checked into version control is one of the most common causes of data leaks. That's why `wdi5` only allows providing credentials through environment variables at runtime.
@@ -351,7 +369,7 @@ Exposing credentials in configuration files that were accidentally checked into
351
369
352
370
There are multiple ways to achieve that in Node.js, with [using the `dotenv`-module](https://www.npmjs.com/package/dotenv) being one of the most popular: `dotenv` automatically transfers all variables from a `.env`-file into the environment of the app at runtime.
353
371
354
-
In single browser scenarios, `wdi5_username` and `wdi5_password` need to be provided.
372
+
In single browser scenarios, `wdi5_username` and `wdi5_password` need to be provided.
355
373
In multiremote scenarios, credential keys in the environment adhere to `wdi5_$browserInstanceName_username` and `wdi5_$browserInstanceName_password`.
356
374
357
375
<!-- tabs:start -->
@@ -381,5 +399,5 @@ wdi5_nix_password='dmac'
381
399
382
400
## Miscellaneous
383
401
384
-
Why the `wdi5:...` prefix?
402
+
Why the `wdi5:...` prefix?
385
403
Because the W3C standard for providing options in the WebDriver protocol asks for any vendor-specfic setting to have a unique prefix.
0 commit comments