WCF Service token authentication

Posted by araman on 30-Apr-2019 07:11

I used the Sitefinity API "/Sitefinity/Authenticate/OpenID/connect/token" to generate the access token. Now I have to validate this access token in my custom WCF services. Is there a similar way to do so. Can anyone please help me with this?

All Replies

Posted by linotadros on 30-Apr-2019 18:05

Hi Araman,

The access token you received from the authentication POST against /Sitefinity/Authenticate/OpenID/connect/token has nothing to do with the WCF services.

The WCF services are pretty much for internal use of Sitefinity like in the backend.  You should use only the ODATA based web services that you got an access token for and continue to use that token in the headers of following calls against the ODATA APIs.

Hope that helps

-Lino

Posted by araman on 02-May-2019 09:43

Hi Lino,

I was in an assumption that I could use the access token created using /Sitefinity/Authenticate/OpenID/connect/token for authenticating my custom services. Thanks for correcting me. Other than the ODATA based Web Services Sitefinity provides I have also created some custom WCF services in my Sitefinity project. I would like to authenticate these WCF services so that everyone cannot access those. Could you please suggest any best option to authenticate these services I have created.

Thanks in advance

Aiswarya Raman

Posted by linotadros on 02-May-2019 12:25

I am sorry I might not be much help here.  I stopped using WCF over 4 years ago in Sitefinity.  Sitefinity's new Web Service implementation is based on "Service Stack".

If your custom WCF services are *.svc implementation then you will probably need to choose how to authenticate against them and include that in the header.

To get an idea, load the backend pages list in Sitefinity and take a look in the Network debugger "Google Chrome or Firebug" to see the call they make against the PagesServices.svc , you will be able to see the entire payload and how they are passing authentication

Again please allow me to recommend to you NOT to use the WCF layer in Sitefinity and try to plug your implementation in the new model under the new architecture.  You will sleep better at night :)

Cheers

Lino

This thread is closed