API Endpoint Authentication - always (401) Unauthorized

Created a simple test endpoint with authentication enabled.

Created app token.

And following the documentation (https://docs.ironmansoftware.com/api/security#accessing-secure-endpoints) I cannot get Invoke-RestMethod to work against this API as it is always unauthorized.

Invoke-RestMethod http://localhost:5000/activedirectory/user/test -Headers @{ Authorization = "Bearer " }

Invoke-RestMethod : The remote server returned an error: (401) Unauthorized.

Any suggestions?

Product: PowerShell Universal
Version: 1.5.1

It’s a problem with a “Never” app token. We will be removing those in 1.5.3 because they don’t work with ASP.NET Core. If you create an app token with a life time of 1 year, it should work.

That was it, now it works. Thanks.