Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.

Commit dd78343

Browse files
authored
Merge pull request #2580 from splunk/adasplunk-O11YDOCS-6673
[O11YDOCS-6673] MFA through TOTP [Mar 4 release]
2 parents bd3ee40 + 2cec446 commit dd78343

File tree

4 files changed

+97
-3
lines changed

4 files changed

+97
-3
lines changed
33.9 KB
Loading
88 KB
Loading
492 KB
Loading

synthetics/test-config/auth.rst

Lines changed: 97 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ The following authentication methods are available for you to configure in your
2626

2727
:ref:`auth-multifactor-email`
2828

29-
:ref:`auth-multifactor-sso`
29+
:ref:`auth-multifactor-sso`
30+
31+
:ref:`auth-multifactor-totp`
3032

3133
* - Uptime
3234
- None
@@ -52,7 +54,7 @@ If your test target provides an HTML form for entering username and password, co
5254

5355
.. image:: /_images/synthetics/auth-basic-html-steps.png
5456
:width: 90%
55-
:alt: Screenshot showing how to set up a synthetic test with basic authentication through an API request header.
57+
:alt: Screenshot showing how to set up a synthetic test with basic authentication through an HTML form.
5658

5759
#. Create global variables for this test target's username and password. Best practice is to conceal the global variable you create for the password. For more information, see :ref:`global-variables`.
5860

@@ -378,7 +380,7 @@ Multifactor authentication through SSO and Active Directory
378380
:description: Multifactor authentication allows your test to authenticate to a target page by logging in through an SSO or Active Directory service.
379381

380382

381-
Authentication through Single Sign-On (SSO) is similar to :ref:`basic authentication <auth-basic-html-login>`. To create a test of that uses SSO or Active Directory (AD) login, you must configure a series of steps that include opening the webpage, selecting the SSO authentication link, and entering the required information for SSO authentication. Additional webpages may load during this process, so it's crucial that you include steps to confirm that all the components of each webpage have fully loaded before proceeding.
383+
Authentication through Single Sign-On (SSO) is similar to :ref:`basic authentication <auth-basic-html-login>`. To create a test that uses SSO or Active Directory (AD), you must configure a series of steps that include opening the webpage, selecting the SSO authentication link, and entering the required information for SSO authentication. Additional webpages may load during this process, so it's crucial that you include steps to confirm that all of the components of each webpage have fully loaded before proceeding.
382384

383385
SSO authentication frequently involves additional authentication factors. If the identity provider (such as Google, Microsoft, Okta, Duo, and so on) does not mandate an extra login factor, your test might only need the authentication steps that are illustrated in the example below:
384386

@@ -394,3 +396,95 @@ Identity providers often require various additional factors for login, such as v
394396

395397

396398

399+
.. _auth-multifactor-totp:
400+
401+
Multifactor authentication through TOTP
402+
==================================================================
403+
404+
.. note::
405+
This authentication method applies to browser tests only.
406+
407+
408+
If your test needs to send a time-based one-time passcode (TOTP) to its test target, configure your test as follows.
409+
410+
411+
Get the secret key for generating a TOTP
412+
------------------------------------------------------------------
413+
414+
The secret key is a shared value which both your test target and your test's authenticator app (such as Okta) will use to generate the same unique TOTP. You can get this secret key from:
415+
416+
* The test target's QR code (an image).
417+
418+
* The plain-text secret key, which is visible as an embedded string in the test target's QR code when you view the QR code as a URL string. For example, if the QR code is ``otpauth://totp/Slack:<username>@<somedomain>?secret=<long-string>&issuer=<app-name>&algorithm=SHA1&digits=6&period=30``, the secret key is ``<long-string>``.
419+
420+
421+
Save the secret key in a global variable of type TOTP
422+
------------------------------------------------------------------
423+
424+
There are two ways to create a global variable:
425+
426+
* From the Splunk Synthetic Monitoring landing page:
427+
428+
#. From the Splunk Synthetic Monitoring landing page, select the settings icon, and then select :guilabel:`Global variables`.
429+
#. Select :guilabel:`Create variable`.
430+
431+
* From an existing test's page:
432+
433+
#. Select :guilabel:`Edit test`.
434+
#. Expand the :guilabel:`Variables` panel on the right, scroll to :guilabel:`Global variables` and select :guilabel:`Add`.
435+
436+
437+
In the :guilabel:`Add variable` dialog box, enter the following:
438+
439+
.. image:: /_images/synthetics/auth-multifactor-totp-add-variable.png
440+
:width: 40%
441+
:alt: Screenshot showing how to create a global variable.
442+
443+
444+
#. In the :guilabel:`Variable` type pull-down menu, select :guilabel:`TOTP`.
445+
#. In the :guilabel:`Variable name` field, enter the name of the variable. You will use this name to access your variable within a test.
446+
#. Save the secret key either by:
447+
448+
* Selecting the :guilabel:`QR code` tab and dragging the QR code image to it.
449+
* Selecting the :guilabel:`Manual input` tab and pasting the ``<long-string>`` you retrieved from the QR code.
450+
451+
#. (Optional) In the :guilabel:`Description` field, enter a description to explain the purpose of the variable for future reference. A description is particularly helpful when you conceal the variable and cannot reveal its value.
452+
#. (Optional) Expand :guilabel:`Advanced Settings` and specify optional settings:
453+
454+
* (Optional) Set :guilabel:`digits` to the number of digits in the generated TOTP. Valid values: 4-8. Default: 6.
455+
* (Optional) Set :guilabel:`TOTP expiration` to the the duration of the validity of the TOTP, in seconds. Valid values: 10s-90s. Default: 30s.
456+
457+
#. (Optional) To validate the secret key you entered, select :guilabel:`Generate TOTP`.
458+
#. Select :guilabel:`Add`.
459+
460+
461+
.. note::
462+
Splunk Synthetic Monitoring automatically conceals the value of variables of type TOTP.
463+
464+
465+
Set up a browser test that uses a TOTP
466+
------------------------------------------------------------------
467+
468+
#. On the browser test's configuration page, select the :guilabel:`Simple` toggle.
469+
#. Select :guilabel:`Edit steps or synthetic transactions`.
470+
#. Add a step of type :guilabel:`Fill in field`, and in :guilabel:`Value`, scroll down to the :guilabel:`TOTP` section (or type ``totp`` into the search field) and select the name of the TOTP variable you created. You can also enter this variable name directly as ``{{totp.<variable-name>}}``.
471+
472+
.. image:: /_images/synthetics/auth-multifactor-totp-fillinfield.png
473+
:width: 70%
474+
:alt: Screenshot showing the "Fill in field" step.
475+
476+
477+
#. To verify that the login succeeded, add a step of type :guilabel:`Assert text present`, and set it up as follows:
478+
479+
#. In :guilabel:`Text`, enter a string that should be visible on the test target page only when login is successful.
480+
#. (Optional) Set :guilabel:`Wait for up to` to a large enough value, in milliseconds, to ensure that the page loads.
481+
482+
#. Select :guilabel:`Submit`.
483+
484+
485+
To verify that the login is working, select :guilabel:`Try now`. Results may take a while. The :guilabel:`Try now result` pane should display each screen that your test navigated to on the target page, plus the message :guilabel:`Success`.
486+
487+
.. image:: /_images/synthetics/auth-multifactor-totp-trynow.png
488+
:width: 70%
489+
:alt: Screenshot showing the "Try now" step.
490+

0 commit comments

Comments
 (0)