c# - WCF Rest service authentication in web config file -
I am developing a WCFRest service and want to authenticate with a single userid and password. Go through a lot of things on the internet. But the thing is complicated. I want to know that single user in web configuration file, there is no way to allow passwords.
& lt; Location path = "test.svc" & gt; & Lt; System.web & gt; & Lt; Authority & gt; & Lt; "?" Denyusers = /> & Lt; / Authorization & gt; & Lt; /system.web> & Lt; / Location
If there is any way to prove it. Please help me on this.
Here's the thing: you do not want to allow only a specific USER, you want to give specific permission There is permission to do this, that is to allow someone to do it using the User ID and Password means that if you ever need permission (because that person has been removed, or because now with that permission 2 people ), Then you have the web The config must be changed and the file can again break the site in extreme cases.
Instead, apply the full membership system, including roles, and then do the following:
& lt; Location Path = "Test. SVC" & gt; & Lt; System.web & gt; & Lt; Authority & gt; & Lt; Allow roles = "[Ronlenamehir]" & gt; & Lt; Deny users = "*" /> & Lt; / Authorization & gt; & Lt; /system.web> & Lt; / Location & gt;
You can add a user that you want to enter into that role standardized for your membership provider, and it will be allowed to access automatically, while everyone Denied.
Comments
Post a Comment