Blog & News

Feature Updates

Cookie Authentication

Mar 10, 20153 min read
PC

Written by

Paul Cray

Co-Founder

Paul co-founded APIContext (formerly APImetrics), building the synthetic monitoring and conformance testing platform from its earliest days.

We support Cookie Authentication using the Post-Conditions section of a test, in conjunction with a multiple-test test run. The general idea would be a test run with the follow:

  1. Call an API which creates the session
  2. In the Post-Conditions, extract cookie value in post-conditions
  3. Call other tests, add a header using the custom variable from (2).

For example, if your API returns a header: 200 OK Set-Cookie: ASP.NET_SessionId=zw4ixeriskyukm5asrdh0nlv; path=/; HttpOnly … In Post-Conditions, add a variable under headers named COOKIE, with the following path: Set-Cookie|replace('; path=/; HttpOnly', '')   Then in the follow-on tests, add a header in the test setup page: Cookie: %%COOKIE%%   If you need any further assistance with this. Please post a comment, or contact us to [email protected]

See what your APIs look like from the outside.

APIContext gives engineering, product, and customer success teams a shared view of API reliability, conformance, and customer impact — without rebuilding dashboards.

Start free