caddy-security icon indicating copy to clipboard operation
caddy-security copied to clipboard

Curl /whoami vs using browser

Open wnke opened this issue 2 years ago • 3 comments

Hello!

When curling the /whoami endpoint like on the example it is missing the userinfo field but it shows when using the browser to access the page.

Is there any endpoint to get the userinfo? Or should I get it via other mechanism?

Kind regards

wnke avatar May 16 '22 22:05 wnke

@wnke , will make an effort adding it in the next version.

In short, this requires modifying pkg/authn/handle_json_whoami.go.

greenpau avatar May 23 '22 01:05 greenpau

@wnke , there was a quick fix for this. You can either wait for the next release or add the following to xcaddy. That would use go-authcrunch with the commit where userinfo is not an issue.

--with github.com/greenpau/go-authcrunch@f9e02ec8a1dae8e4bf6d6976536396ba9e3e9732

It is best if you try with the latter and let me know whether it works (it should).

greenpau avatar May 23 '22 01:05 greenpau

@wnke , this is now in https://github.com/greenpau/caddy-security/releases/tag/v1.1.11.

Please test 😄

greenpau avatar Jun 03 '22 03:06 greenpau