Implement authentication via web.config - ASP.NET Security

Q.  How to implement authentication via web.config?
- Published on 16 Jun 15

a. Include the authentication element.
b. Include the authorization element.
c. Include the identity element.
d. Include the deny element.

ANSWER: Include the authorization element.
 

    Discussion

  • Raj Singh   -Posted on 22 Oct 15
    <configuration>
    <system.web>
    <authentication mode=”Forms”>
    <forms>
    <credentials passwordFormat=”Clear”>
    <user name=”CareerRide” password=”Provide your Password” />
    </credentials>
    </forms>
    </authentication>
    <authorization>
    <deny users="?" />
    </authorization>
    </system.web>
    </configuration>

    In authorization section “?” sign indicates the anonymous user. It means any unauthenticated user cannot access the resource.

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)