asp.net - Active Directory Development Environment -


i have requirement integrate asp.net web application active directory - want able authenticate , authorize ad.

i realise relatively simple, want know how can simulate ad developing , testing against. don't have ad available me (right now) , don't cherish thought of setting if had hardware available run on.

what other options available me? i've seen adam mentioned in couple of places doesn't seem provide federation services need (and seems little out dated). possible use azure this? want keep costs (time-wise money) minimum.

i have managed set active directory environment suitable development using microsoft azure vm.

a brief summary of steps went through working below. although sounds scary setting ad , adfs, windows server 2012 interface makes incredibly easier, barring few gotcha's mention below - takes while them install well.

  1. create new azure windows server 2012 vm , add endpoints http , https.
  2. install ad role on vm
  3. install adfs role on vm
  4. create asp.net mvc 4 app (on dev machine) , verify working correctly.
  5. run app through iis (not iis express - makes ssl etc easier).
  6. ensure site has https binding set up
  7. install identity , access tool vs2012
  8. right click project select identity , access tool.
  9. the path sts meta document https://<your vm url>/federationmetadata/2007-06/federationmetadata.xml (you may need download file manually if certificates self signed).
  10. back on vm, in adfs create relying party trust application.
  11. run mvc app again , should redirected vm authentication , app again (but time using https).
  12. if using default mvc template, in top right corner assuming have set claims correctly, should see hi, <user>@<domain>

the main articles followed achieve follows:

http://blogs.rondewit.com/post/mvc-2b-adfs-20-federated-authentication.aspx http://garymcallisteronline.blogspot.co.uk/2013/01/aspnet-mvc-4-adfs-20-and-3rd-party-sts.html

below list of gotcha's hit (in no particular order).

  1. when setting relying party trust enter data manually , ensure set relying part ws-federation passive protocol url , relying party trust identifiers correctly. first https url adfs redirect after authentication has completed - https://localhost example. second identifier used identify application trying authenticate. 1 of identifiers entered must match realm attribute of wsfederation node in mvc 4 apps web.config.
  2. when logging in username should of form <domain>\<username>
  3. i couldn't windows authentication work browser other ie. set work chrome had change order of local authentication types in web.config of adfs/ls application forms authentication appeared first. this, open iis manager on vm, expand default web site/adfs/ls, right click ls , select explore.
  4. at time of writing haven't been able login ad user created myself - i've not set correctly. when setting initially, i'd suggest trying connect admin user created through azure portal when created vm.
  5. once managed authenticate correctly antiforgerytoken html helper started throwing exception, talking missing claims. ensure have added claim rule relying party trust, sets either name or name id claim. in application_start following: antiforgeryconfig.uniqueclaimtypeidentifier = claimtypes.name; explained here.

it worth noting identity , access tool allows setup authentication azure acs , more noteworthy, development sts. requirements, need able integrate adfs, if you're experimenting claims based authentication, 1 of these may better option process have gone through above.


Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -