Access Token authentication for custom WCF service in Sitefi

Posted by araman on 27-Mar-2019 09:07

I have created a service following the Sitefinity documentation https://www.progress.com/documentation/sitefinity-cms/92/tutorial-create-a-restful-wcf-service-to-retrieve-titles-of-news-items and its working fine. Now I want to implement Access token authentication to this service.

On calling this service from the client the access token will be given in the authorization header. I want to get this access token and authorize before accessing the WCF service. Can anyone please help me with this?

I already tried the steps in https://www.progress.com/documentation/sitefinity-cms/for-developers-secure-your-custom-servicestack-web-service#second-part-use-a-token-to-authenticate-when-calling-your-web-service but it doesn't work for me.

All Replies

Posted by Boyan Barnev on 27-Mar-2019 09:56

Hi,

Can you please clarify whether you are trying to combine the two approaches - having a WCF RESTful service implemented, and trying to secure it, following the approach documented in the quoted article for ServiceStack services?

Generally, the WCF services are no longer the officially recommended approach for developing custom services with Sitefinity. The technology that's better suited is ServiceStack, thus we have retired the WCF instructions and replaced them with ServiceStack for newer product versions in the documentation. 

What I'd recommend is following the samples to implement your desired logic as a ServiceStack service and then utilizing the instructions for securing your service and authenticating with token. Otherwise, if you're trying to secure the WCF service and use the ServiceStack instructions that would not work, simply because the services get resolved via different mechanisms, and the routes are also different.

Please keep us updated on your progress.

Best,

Boyan

Posted by araman on 27-Mar-2019 11:33

Hi,

I have already implemented few WCF service in my project. Now I want to secure one of this using access token. Is there a way to do this in WCF service itself rather than converting the logic in ServiceStack.

Thanks,

Aiswarya

This thread is closed