Configuring application - Example - ASP.NET Security

Q.  You are creating an ASP.NET application for CareerRide. The company uses Microsoft Windows authentication. All users are in the CareerRide domain.

You want to configure the application to use the following authorization rules:

1. Anonymous users must not be allowed to access the application.
2. All employees except Raj and Shiva must be allowed to access the application.

Which code you will apply to configure the application ?

- Published on 24 Jul 15

a.
<authorization>
<deny users=” CareerRide \Raj, CareerRide \Shiva”>
<allow users=”*”>
<deny users=”?”>
</authorization>
b.
<authorization>
<allow users=”*”>
<deny users=” CareerRide \Raj, CareerRide \Shiva”>
<deny users=”?”>
</authorization>
c.
<authorization>
<deny users=” CareerRide \Raj, CareerRide \Shiva”>
<deny users=”?”>
<allow users=”*”>
</authorization>
d.
<authorization>
<allow users=” CareerRide \Raj, CareerRide \Shiva”>
<allow users=”*”>
</authorization>

ANSWER:
<authorization>
<deny users=” CareerRide \Raj, CareerRide \Shiva”>
<deny users=”?”>
<allow users=”*”>
</authorization>
 

    Discussion

  • Digvijay   -Posted on 21 Sep 15
    First you deny user Raj and Shiva access. Then you deny anonymous users access by writing . Finally we grant all other users access. This is proper order of the elements for the requirements of this scenario.

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.)