26.02.2015 Views

DOT NET Interview Questions - DotNetSpider

DOT NET Interview Questions - DotNetSpider

DOT NET Interview Questions - DotNetSpider

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

can say the following authentication is the process of obtaining some sort of credentials<br />

from the users and using those credentials to verify the user’s identity. Authorization is<br />

the process of allowing an authenticated user access to resources. Authentication is always<br />

precedes to Authorization; even if your application lets anonymous users connect and<br />

use the application, it still authenticates them as being anonymous.<br />

(I) What is impersonation in ASP.<strong>NET</strong> ?<br />

By default, ASP.<strong>NET</strong> executes in the security context of a restricted user account on the<br />

local machine. Sometimes you need to access network resources such as a file on a shared<br />

drive, which requires additional permissions. One way to overcome this restriction is to<br />

use impersonation. With impersonation, ASP.<strong>NET</strong> can execute the request using the<br />

identity of the client who is making the request, or ASP.<strong>NET</strong> can impersonate a specific<br />

account you specify in web.config.<br />

(B) Can you explain in brief how the ASP.<strong>NET</strong> authentication<br />

process works?<br />

ASP.<strong>NET</strong> does not run by itself it runs inside the process of IIS. So there are two<br />

authentication layers which exist in ASP.<strong>NET</strong> system. First authentication happens at<br />

the IIS level and then at the ASP.<strong>NET</strong> level depending on the WEB.CONFIG file.<br />

Below is how the whole process works:-<br />

√<br />

√<br />

√<br />

√<br />

IIS first checks to make sure the incoming request comes from an IP address<br />

that is allowed access to the domain. If not it denies the request.<br />

Next IIS performs its own user authentication if it is configured to do so. By<br />

default IIS allows anonymous access, so requests are automatically<br />

authenticated, but you can change this default on a per – application basis<br />

with in IIS.<br />

If the request is passed to ASP.net with an authenticated user, ASP.net checks<br />

to see whether impersonation is enabled. If impersonation is enabled, ASP.net<br />

acts as though it were the authenticated user. If not ASP.net acts with its own<br />

configured account.<br />

Finally the identity from step 3 is used to request resources from the operating<br />

system. If ASP.net authentication can obtain all the necessary resources it<br />

grants the users request otherwise it is denied. Resources can include much<br />

125

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!