2-Step authentication issue

I'm trying to use the 2 step auth with no success, the [auth_token] does not passed from the authentication call to the api query call.
When I add the auth_token manually in the api query call, it works well... see screenshot.
Anyone succeed with it?


  • 0
    David Komando

    I have the same question as the OP.

    1. Is the RegEx used in the Token Path formatted properly for a JSON response?

    2. Is the Bearer [auth_token] in the correct format to be mapped properly?


    The support docs are kinda vague and seem only half baked with only a Pardot example and no example on how to set the captured key:

    - What kind of data capture example "<api_key>(.*?)</api_key>" was used, was that XML from Pardot?

    - Also, nothing about how to set the captured api_key if needed.

    - No links out to dynamic setting of variables.


    Is this something that would be better to open a ticket to get help?

  • 1
    Christian Bourque

    Hi all,

    I was having the same problem as the OP and I was able to find the right configuration based on his screenshot after changing a few settings (I'm using Keycloak as my IdP):

    REST/URL Data Source

    Query URL: https://myapp.com/api/myservice
    Data Format: JSON
    Encoding: UTF-8
    Method: GET
    Query Parameters
            Name: Authorization
            Value: Bearer [auth_token]
            Type: Header

    Authentication (OAuth, 2-Step, X-WSSE, or Basic) :

    Type: 2-Step Authentication
    Username: [BLANK]
    Password: [BLANK]
    Response: Text
    Method: POST
    Body: client_id=myclient&client_secret=999999999999999&grant_type=client_credentials
        Name: Content-Type
        Value: application/x-www-form-urlencoded
        Type: Header

    Auth URL: https://myidp.com/auth/realms/myrealm/protocol/openid-connect/token
    Token Path: "access_token":"(.*?)"
    Logout Method: GET
    Logout URL: https://myapp.com/logout

    The key settings were these:

    1. Set Response to Text (even though the answer is a JSON payload, it seems that Klipfolio will convert it to text and replace all apostrophes with quotation marks).
    2. Set Token Path to (no space after the colon): "access_token":"(.*?)"

    Hope this helps!


Please sign in to leave a comment.