West Wind WebSurge
Using Websurge for API testing followup
Gravatar is a globally recognized avatar based on your email address. Using Websurge for API testing followup
  Richard Kaye
  All
  Nov 2, 2023 @ 11:20am

Hi Rick,

Thanks again for the time yesterday. It was very helpful.

I'm trying to take advantage of some of the things you showed me in Websurge (WS) and must be missing a fine detail. As you recall, we created SignIn and ValidateToken methods. The former completes with a 200 in WS and I get my token value. I want to use that token in the validateToken test but so far have been unsuccessful in getting WS to inject(?) the Authorization bearer header.

In the SignIn request header, I have this:

WebSurge-Request-CaptureAndSetAuthorizationBearerTokenFromJson: token

I see the Bearer value getting saved into the WS session settings.

I have placed this directive in the request header for the validateToken test:

WebSurge-Request-InjectJsonBearerToken: token

Unfortunately I'm not getting the Auth header. I must be doing something wrong. Suggestions?

TIA

Gravatar is a globally recognized avatar based on your email address. re: Using Websurge for API testing followup
  Rick Strahl
  Richard Kaye
  Nov 3, 2023 @ 10:44am

You don't need the second header when you use the first to capture your token.

You need to make sure though you have an authorization header in each request with a Bearer token that's either set or empty:

Authorization: Bearer

The header will be filled with the Session level bearer token.

More info here:

Capturing and setting Authorization Tokens

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Using Websurge for API testing followup
  Richard Kaye
  Rick Strahl
  Nov 3, 2023 @ 12:16pm

Thanks! I figured that out today.

© 1996-2024