How to restrict the access to resful webservice in WCF 3.5?i just want the access to the webservice be available to selected users,i dont want certificate based authentication.How to achieve this?
As stiletto says - you should be able to place the authorization into the headers - although to be honest I'm having fun and games getting that working. You could of course pass some kind of token in the parameters but this quickly becomes a royal pain -
and validation has to be added to each and every method.
Adding it to the Headers also means you can intercept the message before it gets to the methods themselves - this allows you to seperate the security handling code from the implementation - and it does not need to execute the method in order to validate
the user.
percybhai
0 Points
3 Posts
RESTful webservice authentication
Dec 20, 2009 12:52 PM|LINK
Hi,
How to restrict the access to resful webservice in WCF 3.5?i just want the access to the webservice be available to selected users,i dont want certificate based authentication.How to achieve this?
stiletto
All-Star
16995 Points
3304 Posts
Re: RESTful webservice authentication
Dec 23, 2009 12:20 PM|LINK
You just package the current user credentials (whatever they may be) as part of the request.
If you can't add them as specific parameters, I've seen techniques where they credentials are added to the headers being sent with the request.
PAULSC
Member
41 Points
22 Posts
Re: RESTful webservice authentication
Apr 17, 2011 08:37 PM|LINK
As stiletto says - you should be able to place the authorization into the headers - although to be honest I'm having fun and games getting that working. You could of course pass some kind of token in the parameters but this quickly becomes a royal pain - and validation has to be added to each and every method.
Adding it to the Headers also means you can intercept the message before it gets to the methods themselves - this allows you to seperate the security handling code from the implementation - and it does not need to execute the method in order to validate the user.
That's the theory anyway.
paodeoro
Member
4 Points
2 Posts
Re: RESTful webservice authentication
Jun 16, 2011 06:39 PM|LINK