Request and Validate Sitefinity SWT
Hi SF developers,
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.
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;
@Vassil
..."IsUnrestricted" is that a combination of backend and admin or something?....
Hi,
A role is unrestricted when it is granted ultimate permissions.
Regards,
Vassil Vassilev
Well there's no Ultimate Permission button :) ...so is it just Administrator or...?
Do you know what I mean?
Hi Steve,
Correct, IsUnrestricted returns a bool value if the user belongs to an Administrators role.
Regards,
Vassil Vassilev
Telerik