Build an _authping flow

An _authping flow is a system flow used by the platform to call an API and check for valid authorization.

This action acts as a validation check and runs when you first authenticate the connector, add new connectors, or open flows.

The flow must be named _authping for the platform to recognize it. End users don't see the _authping flow as only the platform uses it. The flow has no options or input fields.

Here's an example of what a complete _authping flow looks like in Okta Workflows.

Before you begin

To build this common flow, first you need to:

Start this task

  1. Create a new flow under the Flows tab by clicking on + New Flow in the upper right corner of the page.

  2. At the far left of the page, click Authping.

  3. Click the Save button in the toolbar and name the flow _authping. Note that _authping is a reserved name and must be exact.

  4. In the flow description field type Connection health check, check the Save all data that passes through the Flow box, and click Save.

  5. Add an Error Handling If Error card as the first card in the flow.

  6. Add a Flow Control Call Flow card inside the Try section of the card.

  7. Click on the Choose Flow button and select the httpHelper flow created previously. The card will automatically populate with the inputs defined in the httpHelper flow.

  8. Manually enter the relative url of the endpoint to use as a "ping". The endpoint should require authorization from the server, and the ping response should contain a small packet of data including a standard HTTP status code.

  9. Manually enter a request method (GET, PATCH, POST, PUT, or DELETE).

  10. Enter any additional information required for the call in the query, headers, or body field. You may need to add an Object Construct card before the Call Flow card to build out any necessary objects.

  11. For the outputs on the Helper Flow card, you'll need to define the same keys as on the httpHelper flow's outputs:

    • status_code (Number)

    • headers (Object)

    • body (Object)

  12. Add a Flow Control Assign card to the right of the Call Flow card that is inside the If Error function. Click Click or drop here to create and name the field message.

  13. Manually add a success message in the new field. For example: This account is successfully connected.

  14. Click on the View Outputs link at the top right of the Error If card to expand the card's outputs section.

  15. In the outputs section, click Click or drag to create and enter status_code. Two inputs will appear that read Drag output here.

  16. Drag the status_code output field from the Call Flow card into the top of the two inputs under the status_code field.

  17. In the outputs section, click Click or drag to create and enter message.

  18. Drag the message output field from the Assign card into the top of the two inputs under the message field.

  19. Select the dropdown at the top of the If Error card and select If Error. This is where any service specific error handling can be managed.

  20. Depending on the service, add additional keys to the Error object in the left panel of the If Error card to pull the status code and error message from the object returned by the service. Add keys by clicking Enter key name.

  21. Drag these new keys into the corresponding outputs of the If Error card.

  22. Add a True/False Compare card to the right of the Error Handling If Error function card.

  23. Drag the status_code field from the If Error card outputs into the value a field of the Compare card, and make sure the comparison is set to equal to.

  24. In the value b field, enter the status code of a successful request. In most cases, this will be 200.

  25. On the True/False Compare card, to name the output field working, click the field's dropdown, then click customize. Note that the naming of these fields is a best practice and not a requirement.

  26. Drag the working output from the Compare card into the working field on the Return Status card.

  27. Add an Object Construct card.

  28. Click Click or drop here to create and add a label named statusCode.

  29. Drag the status_code field from the If Error card outputs into the new statusCode field of the Construct card.

  30. Add another input field to the Construct card and name it body.

  31. Drag the message output field from the Assign If card into the body field on the Construct card.

  32. On the Object Construct card, rename the output field to serviceResponse.

  33. Drag the serviceResponse output from the Construct card into the serviceResponse field on the Return Status card.

  34. Drag the auth object from the Connector Authping card to the Connection input field of the Call Flow card.

  35. Save and test your flow.

Next steps

Build a custom API action card