Request and Validate Sitefinity SWT

Posted by Community Admin on 04-Aug-2018 01:32

Request and Validate Sitefinity SWT

All Replies

Posted by Community Admin on 28-Apr-2014 00:00

Hi SF developers,


I'm trying to integrate Sitefinity's claims based authentication with our web api. The requirement is quite simple:

User logs into Sitefinity with a user name and password, when the widget needs to call the backend WebApi, it retrieves a token from Sitefinity and presents it to the api. The Api validates the token and if valid, perform the action, otherwise reject it.


Does this sound like a simple and reasonable scenario with Sitefinity?


I've configured sitefinity 6.3 to use Claims Based Authentication and added a replying party for the web api host.


What I need some help with is sample code on how to request and validate the token.


Thanks in advance.

Walter

Posted by Community Admin on 08-May-2014 00:00

Hello Walter,

Actually once a user has been susscessfully logged you could perform the following:

var user = ClaimsManager.GetCurrentIdentity();
var isAuthenticated = user.IsAuthenticated;
var isBackend = user.IsBackendUser;
var isUnrestricted = user.IsUnrestricted;

Hope this helps

Regards,
Vassil
 

Posted by Community Admin on 08-May-2014 00:00

@Vassil

 ..."IsUnrestricted" is that a combination of backend and admin or something?....

Posted by Community Admin on 09-May-2014 00:00

Hi,

A role is unrestricted when it is granted ultimate permissions.

Regards,
Vassil Vassilev

Posted by Community Admin on 09-May-2014 00:00

Well there's no Ultimate Permission button :) ...so is it just Administrator or...?

 Do you know what I mean?

Posted by Community Admin on 09-May-2014 00:00

Hi Steve,

Correct, IsUnrestricted returns a bool value if the user belongs to an Administrators role.

Regards,
Vassil Vassilev
Telerik

 
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
 

This thread is closed