asp.net mvc - MVC2 Active Directory Authentication -


i'm trying add active directory authentication desk system built years ago. gradually, we'll upgrading whole system. i'm starting creating mvc2 application host login, , plan bring current functionality mvc add new features.

but login base of whole thing. need auditing, need know who's in system.

i've read articles, other stackoverflow posts, , followed couple ms walkthroughs letter. able working asp website, when it's mvc application, can't seem it. asp application required adding extensive methods, , read makes sound mvc should simpler.

here iis settings , mods i've made web.config:

iis authentication

  • anonymous: disabled
  • asp.net impersonation: disabled
  • forms: enabled
  • windows: disabled

    ... ...

i keep getting following error:

http error 401.2 - unauthorized not authorized view page due invalid authentication headers.

end goal authenticate user @ home page. if can't authenticated, force login.

edit: enabled anonymous authentication

i enabled anonymous authentication see if underlying errors might source of problem. got following error:

the container specified in connection string not exist.

it's finding error in definition of myadmembershipprovider.

<add name="myadmembershipprovider" type="system.web.security.activedirectorymembershipprovider, system.web, version=2.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a" connectionstringname="adconnectionstring" /> 

i changed connection string following:

<add name="adconnectionstring" connectionstring="ldap://server.domain.com"/>

that did redirect login page, didn't authenticate me automatically. , when set anonymous disabled again, original error.

i think i'm missing essential knowledge here i'm not getting materials i'm reading.

edit: authentication not working @ all

i thought might worth adding authentication isn't working @ all.membershipservice.validateuser returns false.

i think solution in authentication type. originally, using following:

iis authentication

  • anonymous: disabled
  • asp.net impersonation: disabled
  • forms: enabled
  • windows: disabled

and in web.config file using forms authentication. apparently active directory authentication, type has windows.

original:

<authentication mode="forms">   <forms loginurl="~/account/logon" timeout="2880" /> </authentication> 

revised:

<authentication mode="windows" />  <authorization>   <deny users="?" /> </authorization> 

i know worked, since i'm new mvc, still missing something.


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -