Skip to main content

Configure Impersonation Authentication in IIS8 for MVC Application

Impersonation is when ASP.NET executes code in the context of an authenticated and authorized client. By default, ASP.NET does not use impersonation and instead executes all code using the same user account as the ASP.NET process, which is typically the ASPNET account.

There are 5 below steps by which we can establish Impersonation configuration in our secured application environment.

1.)    Creation of Application/Proxy user where Application is hosted.
2.)    Give appropriate access to the user.
3.)    Create Database Login user on database.
4.)    Authenticate User and provide credential on IIS.
5.)    Then Configure web.config on Application.



Creation of Application/Proxy user where Application is hosted and Give appropriate access to the user.


Create Database Windows Login in Database.



Now Open IIS Manager and navigate to the level you want to manage.
1.       In Features View, double-click Authentication.
2.       On the Authentication page, select ASP.NET Impersonation.
3.       In the Actions pane, click Enable to use ASP.NET Impersonation authentication with the default settings.
4.       Optionally, in the Actions pane, click Edit to set the security principal.
5.       In the Edit ASP.NET Impersonation Settings dialog box, select either Specific user or Authenticated user. Whichever you decide, IIS uses this identity for the security context of the ASP.NET application. By default, IIS 8 is set to impersonate the authenticated user.
6.       Click OK to finish or proceed to the next optional steps to change the identity to impersonate.
7.       Optionally, click Set to change the Specific user identity.
8.       In the Set Credentials dialog box, enter the name of an existing user account in User name, the password associated with that user account in Password, and then the exact same value in Confirm password for a new account IIS should use for anonymous access.
9.       Click OK to close the Set Credentials dialog box.
10.   Click OK to close the Edit ASP.NET Impersonation Settings dialog box.







Then Configure web.config on Application

Configure Aspnet/MVC app’s web.config as below
<configuration>
  <connectionStrings>
 <add name="xxxxx" connectionString="Database= Test;Server=SUMAN-29\MYSERVER;Integrated Security=SSPI; " providerName="System.Data.SqlClient" />
 <add name="ApplicationServices" connectionString="data source= SUMAN-29\MYSERVER;Integrated Security=SSPI; ; Initial Catalog=Test" providerName="System.Data.SqlClient" />
 </connectionStrings>

and

        <identity impersonate="true" password="@#@$@$@$@" userName="xxx" />


if SSL is enable  then
<authentication mode="Forms">
      <forms loginUrl="~/Account/LogOff" name="tech" timeout="30" requireSSL="True" />
    </authentication>




 Now Connect, Test and Discover
Seems it is opening …. 
#YoYo this is working and application goes live…



Comments

  1. Hello! I know this is somewhat off topic but I was wondering if
    you knew where I could locate a captcha plugin for
    my comment form? I'm using the same blog platform as yours and I'm having difficulty
    finding one? Thanks a lot!

    ReplyDelete
  2. If some one wants expert view regarding blogging and site-building afterward
    i recommend him/her to pay a quick visit this weblog, Keep up the
    pleasant job.

    ReplyDelete
  3. Pretty nice post. I just stumbled upon your weblog and wanted to say that I
    have truly enjoyed surfing around your blog posts. In any case I'll be subscribing to your rss feed and I hope you write
    again soon!

    ReplyDelete
  4. I am truly glad to glance at this web site posts which consists of
    plenty of useful information, thanks for providing such information.

    ReplyDelete
  5. I know this if off topic but I'm looking into starting my own blog and was
    wondering what all is needed to get setup? I'm assuming having a blog
    like yours would cost a pretty penny? I'm not very web savvy so
    I'm not 100% certain. Any suggestions or advice would be
    greatly appreciated. Thank you

    ReplyDelete
  6. What's up to every body, it's my first pay a quick visit of this web site; this
    web site contains amazing and actually good stuff designed for
    visitors.

    ReplyDelete
  7. continuously i used to read smaller posts which as well clear their
    motive, and that is also happening with this post which I am reading at this place.

    ReplyDelete
  8. Do you have a spam issue on this blog; I also am a blogger, and I was
    curious about your situation; we have created some nice practices and we are looking to swap
    techniques with others, be sure to shoot me an email if interested.

    ReplyDelete

Post a Comment

Plz dont forget to like Facebook Page..
https://www.facebook.com/pages/Sql-DBAcoin/523110684456757

Popular posts from this blog

mongoDB error : aborting after fassert() failure

What to do when facing errors on mongoDB “aborting after fassert() failure”

I like errors, in mongoDB this is the first error I faced and luckily many times. This error i faced during restoring name-space on local and restarting db system. I am still searching the exact root cause of this issue but i am able to resolve the current problem through below steps.

Remove all relevant namespace files from data-file route path..Now repair mongo instance using mongod process.mongod --repair ////////// execute command from bin folder path Then start server using mongd process, if started server successfully then ..mongod  ////////// execute command from bin folder path Restore last backups as normal process.Now check database by connecting mongo shell. Thanks for reading, 
Please comment your experience if you faced and also share knowledge if you have better steps to resolve...


https://www.facebook.com/pages/Sql-DBAcoin/523110684456757

SQL71562: external references are not supported when creating a package from this platform

Last week I got this error from one of developer who was trying to deploy his project from Testing server to SQL Azure QA server. He was using “Deploy Database to SQL Azure” option from SSMS Tool-Task option.

After connecting to SQL Azure portal when operation started to deployment below errors occurs.

Validation of the schema model for data package failed. Error SQL71562: Error validating element xx.xxx.xx:function .dbo.xxx has an unresolved refrence to object xx.dbo.xxxx external refrences are not supported when creating a package from this platform.



Reason: The reason of the this error was; some functions of project was dependent on master database and only single database was being deploy to SQL Azure. DACFx must block Export when object definitions (views, procedures, etc.) contain external references, as Azure SQL Database does not allow cross-database external references So, this error was coming.

Solution : I suggested him to create those function to locally on local database what…

How to recover msdb database from suspect mode

It was Monday 9th Jun 47 degr. temperature of Delhi-NCR. Temperature was like boiling me and database. When I reached my office( @ 8.45 am) got an alert from one of Server.
“MSDB is in suspected mode” At the same time comes in my mind, this issue will boil me today.. I just tried to cool my self through cold drink then connected server from my local system using windows authentication mode..