Autoquery viewer for authenticated endpoints

Is there any way to use the autoquery viewer for authenticated endpoints? I don’t like commenting the authentication out to test as I might forget to add it back in.

Are you using Session/Cookie-based Authentication?

Because the Ajax API requests should contain the Cookies.

Yes. I think the issue may be we run the front-end locally on a different port than the API.

The API runs on https://localhost:44308/ and the front end on https://localhost:4200 (Angular dev server).

When I hit https://localhost:44308/autoquery/metadata after loggin in it shows unauthenticated after I log in on front end.

I went into Swagger UI and authorized and then viewed AutoQuery again and it still shows unauthorized.

What is easiest way to set the cookie for AutoQuery?

You’ll need to transfer the cookies across to another site, there’s an example where this is done in TechStacks where it converts the current session of 1 site into a token that it passes to the 2nd site before converting it to a HTTP cookie.

The PostmanFeature has a Session Export feature you could use by registering it at:

Plugins.Add(new PostmanFeature { 
    EnableSessionExport = true
});

Then going to /postman?exportSession=true will redirect you to a URL like /postman?ssopt=temp&ssid={key}&sspid={key} which you can copy to a different domain to override the session cookies.