Custom Web API with Claims Security

Posted by Community Admin on 04-Aug-2018 17:43

Custom Web API with Claims Security

All Replies

Posted by Community Admin on 22-Nov-2016 00:00

I'm building a custom ASP.net web api in Sitefinity 9.1. I would like consumers to be able to use the same claims authentication they would against the built in Sitefinity web services --that is call sitefinity login endpoint, get a token and pass that claim token to my endpoint. I've built the api and am calling it via this test rest clent app published by Progress (github.com/.../RESTfulSitefinityClient). The test app does everything right --gets a token and passes it as a header to the API. The problem is, within the API itself, I can't seem to be able to get ahold of the actual user. I'm trying to get the user in the API by calling var identity = ClaimsManager.GetCurrentIdentity(); However, "Anonymous" is always returned. Any thoughts?

Posted by Community Admin on 15-Sep-2017 00:00

Hi Adam,

Did you ever resolve this? I'm having the same problem!

Posted by Community Admin on 15-Sep-2017 00:00

For anyone who runs into the same issue. You can resolve it by having your custom api use a different route. /api is used by Sitefinity by default. Switching your custom code to user a different route should solve the issue.

This thread is closed