Skip to content

Commit

Permalink
[Synthetics]: fix MFA totp method for browser monitors
Browse files Browse the repository at this point in the history
  • Loading branch information
vigneshshanmugam committed Nov 25, 2024
1 parent 7ad7d16 commit 72af0b8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions docs/en/observability/synthetics-mfa.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import { journey, step, mfa} from '@elastic/synthetics';
journey('MFA Test', ({ page, params }) => {
step('Login using TOTP token', async () => {
// login using username and pass and go to 2FA in next page
const token = mfa.token(params.MFA_GH_SECRET);
const token = mfa.totp(params.MFA_SECRET);
await page.getByPlaceholder("token-input").fill(token)
});
});
Expand All @@ -51,12 +51,12 @@ For monitors created in the Synthetics UI using the Script editor, the `mfa` obj

```ts
step('Login using 2FA', async () => {
const token = mfa.token(params.MFA_GH_SECRET);
const token = mfa.totp(params.MFA_SECRET);
await page.getByPlaceholder("token-input").fill(token)
});
```

[NOTE]
====
`params.MFA_GH_SECRET` would be the encoded secret that was used for registering the Synthetics Authentication in your web application.
`params.MFA_SECRET` would be the encoded secret that was used for registering the Synthetics Authentication in your web application.
====
6 changes: 3 additions & 3 deletions docs/en/serverless/synthetics/synthetics-mfa.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import { journey, step, mfa } from "@elastic/synthetics";
journey("MFA Test", ({ page, params }) => {
step("Login using TOTP token", async () => {
// login using username and pass and go to 2FA in next page
const token = mfa.token(params.MFA_GH_SECRET);
const token = mfa.totp(params.MFA_SECRET);
await page.getByPlaceholder("token-input").fill(token);
});
});
Expand All @@ -55,12 +55,12 @@ For monitors created in the Synthetics UI using the Script editor, the `mfa` obj
[source,ts]
----
step("Login using 2FA", async () => {
const token = mfa.token(params.MFA_GH_SECRET);
const token = mfa.totp(params.MFA_SECRET);
await page.getByPlaceholder("token-input").fill(token);
});
----

[NOTE]
====
`params.MFA_GH_SECRET` would be the encoded secret that was used for registering the Synthetics Authentication in your web application.
`params.MFA_SECRET` would be the encoded secret that was used for registering the Synthetics Authentication in your web application.
====

0 comments on commit 72af0b8

Please sign in to comment.