More in this section

Forums / Developing with Sitefinity / Custom Web API with Claims Security

Custom Web API with Claims Security

3 posts, 0 answered
  1. Adam
    Adam avatar
    23 posts
    Registered:
    05 Apr 2013
    22 Nov 2016
    Link to this post
    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 (https://github.com/svetlay/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?
  2. Killian
    Killian avatar
    0 posts
    Registered:
    12 May 2015
    15 Sep in reply to Adam
    Link to this post

    Hi Adam,

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

  3. Killian
    Killian avatar
    0 posts
    Registered:
    12 May 2015
    15 Sep
    Link to this post
    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.
3 posts, 0 answered