We’re trying to build asynthetic browser test against a site that requires OTP.
As there is no direct API to get the OTP data from the provider we need to bypass it so we’ve created a “back door” workflow to extract it and generate a business event that will store the result. we now in the stage that we need to query it using DQL from the script but facing CORS error as the Dynatrace domain is different than the tested site.
we already know the great article from @HannahM however the current issue is how to avoid the CORS error when accessing the platform without signing in to the platform itself (as accessing the domain itself directly goes to the login page).
Does it matter that you only go to the login page? You could ignore the 401 error, if that’s causing a failure, or is it that the login page is another domain so doesn’t help?
It runs after I navigate to my tenant url and being redirected to the sso page.
The fetch itself fails at the end and the message is plain “fetch failed”. we’ve even changed the original website to another one. any thoughts? (I think this discussion is important to many use cases hence this is not directly also managed in a ticket - let me know if only a summary should be done here)
if I understood correctly, you have a Workflow that retrieve the OTP and stores as business events. And now, you are using the synthetic step to query this value to use it as authentication… right?
Why not store the OTP in a credential vault instead, that can be used natively by synthetics?
@dannemca had to remove teh solution as it seems that the credentials vault is loaded when the test is initiated and is not being refreshed/online accessed for the latest data. This means that updating the vault in the background will only be effective for the next run.
We’re back at square one of how to pass the OTP value to the test. API calls to the grail events (using the apps host) are getting the CORS errors. we’re looking into classic API’s which are currently working but this is not a long term solution. @HannahM any ideas as well?
While it may seem like a roundabout path , I suugest a workflow
- get the credential
- update the vault
- On demand monitor executions API to run the synthetic test.