Windows Authentication With ASP - NET Web Pages PDF

You might also like

Download as pdf
Download as pdf
You are on page 1of 6
sis2017 Windows Authentication With ASPINET Web Pages My site uses cookles to personalise content and adverts, to provide socal media features and to analyse traffic. rim happy withthe Windows Authentication With ASPNET Web Pages on upto 1938 fete ee assists r2conmens The default authentication mechanism bulltinto ASP.NET Web Pages site templates fs Forms Authentication via the SimpleMembershipProvider, Which i designed co enable authentication of users against a database, This requires the user to know their user name and password, and to tenter those whenever they want to log in to access restricted areas within a site. {you are using the ASP.NET Web Pages framework to bull an Intranet ste that wil be hosted within your own corporate netwerk (ie. client machines and web server are inthe same domain, you can use Integrated Windows Authentication instead which simplifies authentication dramatically Incgrated Windows Aathentcation is the preferred approach to authentication whenever uses are part ofthe same Winds domain as the server, Users are aushenscated aginst an esting idencty store such as Active Director, and ther credentals ae not wansmisted across the intemet. maddton, users are provided ‘numberof akernatives to Integrated Windows Authentication: Basic, Digest and Client Cetiate, but only integrated Windows Authentication provides strong auchentcation without the hassle af managing client catieaes. is therefor the recommends oto Contiquing Integrated Windows Autheriation is quite stalght onward, but there are a number of steps hat nee tebe followed. The ist step change the web con lta spec that Windows Authentieation sto be used forthe sts foppsetings " “Jeontigertion> Thereare tree rams to noe: fstan apseteings entry is added to turnoff Smple Membership, which oles on Forms Auth! ‘The nex step so ensure that your Web server is et upto manage Windows Authentication forthe st, Te do this, you need to expt sable anonymous access {whi allows anyone ta access he site thot haunt authenticate) and enable Windows Authentication, WebMatix doesn offer any GUL management tots oF IS Expres, 2 need o beste the appieaionhost.conig fle (ypcaly located in C\Users\your_username>\Decumentslsexpresscovigh aving done that, ‘navigate all the way athe Bottom where you sould find the clsing ag, Add the following, where "Windows Auth the name of your ste: secur 1 Express for Web does provide a vi means to manage these sengs you can configure them with :wo dick nthe ste properties: hhipeuhwwr mikescoineting com/erce/2@hvindows-aubericalion-withasp-net-web-pages 6 sis2017 Windows Authentication With ASPINET Web Pages 60a b-e0ad) +B) Sexes Saiton pi Ci 2 Tl ston tees 0 0 po) 26 Wbws as Ys app Des ben 1 Detatcnmd B tencenee Peco webct Windows Auth Web te Propet Enis 5 begs We er (dnc incienggitne rape presi Papa Developer Web Sever ‘There an ateratve way to dlsable anonymous access to the sit, and that's to ad the following to your web.config Sle wthin the systema node: When you deplay the et te fullversion of, you can use he standard WS administrative tools ta manage coniguration. Fst, you ned to ansue that Windows ‘athentication is enabled forthe we server. You ean do this by gong ta Contra Panel» Programs ana Features, an then eickng Turn Windows features on or off (lttnand sts, Locate Internet Information Services and hen dilldown to Secu and ensure that Windows Authentication f checked Tur Windows features on or off e ‘Tetum eferreon ade check bor Tatum afer a 2 Crete escent emp nts tamed a ST eenetteson Ser PFD {ELI Wak Manageme Tot HL Wot ek Serene ll Hostion Deepens TEIMIL Conon HT Fees TF, Chan Conte Mapinghanerticaion [Ek ges thereon [Care cenente aging hhenaton Ft Bsecusy [EI Reet icing Fo ual ameron Fh Widower | Ce bee) ‘once you have created he sein IS, goto Feature View and cick Authenteation: hhipeuhwwr mikescoineting com/erce/2@hvindows-aubericalion-withasp-net-web-pages sis2017 Windows Authentication With ASPINET Web Pages @ Windows auth tome fee = DAlGe = Esto at | Gowptye es a oo a. & ee ee ee 9 ls re) G@rd*eF & @ EE Borie ap tition ttle gk te o @ Make sue that he optons are the same as you sein Express: Anorymeus Authentication should be dsabled, and Windows Authentication enabled @ futhen Gimp. Ho soup = ‘Sas Repos re PoarymousAamertcton ——_Osabes ASPET mpeserion ‘bes ec utercaton Cetbed ——HITPADLcatenge Dye aehemezion Dabs ——HITPAoLcatenge indons ueraten fvieh_——_HITPADICatenge Working with users and roles srs are logged in automatically and thelr dant is stored inthe Identity property ofthe User obec. The User objec is an Instance ofthe Irina nertace The Lnde-ing ype the Windows acne (pnp, micosof comfenars/ibrarSystem Secu Principal Windows ?ratipalason css. You can get the name of ‘heuse fom user-tentsty.Aare. The vale returned fom ths inthe form DomainNamelUserfame or MachineName\UserName. For examate, have a Windows login fora domain calle CONTOSOOY, the value returned by User Identity Nae might be COMOSEA wikebig Some pars ofthe Intranet might ony be accesible to members of certain Windows groups (oes such as Administrator or Sales, In order to determine whether the Curren user belongs oa sped group, you use the UserIsinole method ‘es(usertetmole(@"BUILTEN\Aaninistrators") || Ure. atesole(B"UOMAIN\SA}8=")( ‘ , ‘You can also use an override ofthe lingo meth tha lakes a WidowsduilnRole enumeration, though you have to cast he User object toa WindowsPrincipal rouse this option hhipeuhwwr mikescoineting com/erce/2@hvindows-aubericalion-withasp-net-web-pages sis2017 Windows Authentication With ASPINET Web Pages ‘using Syston. secursty.Prinetpals « var user = (uindouPrincipatuser ‘aren tetnfoletindnsasintzaole.Adnintseraton)¥ ‘uses an sdninserator| , > "Note that you also need to ade a sing irectve to reference the System Securiy Principal namespace numetations ae god, that Inlelsense oer code ‘completion and compile me checking but you cee use the approach to test for memersip of custom groups that you have created such asthe Sales one inysrated eater ‘You cant do very much with groups o oles when using Windows Authentiation. However, you can aethate the WindowsTokenRoleProwder (tuptémsso mictosof.confer-us\branystem web scuty wndowstokenroleorvier asm if you do eed to make use offs lied features. Todo this, add the fetloing to your web.config win the systerneb node “eles acd naneitndowtrovsaer” type roleanager> Syston. Security WindourTocetolefravicar® (> ‘The frst thing to point outs tha you enable this eave, you can ne longer us the WindowsBuitnRole enumeration option wi the User soe method bbecaur he underlying te or User has naw become 2 RolePrncipal ype hth canna be converted to WindowsPrincpal. You can continue use the User siole method tha accepts string or you can use the Roles sUserInolestrng, string) method, that takes the username andthe role to check against. The only ther maaringfulmathod exposed by the WindoweTokenRolProvders the GexRolesForUser method which returns an aay of rls: ‘oreaen(var ole tn Roles. cetaolerForusert))¢ “alwuser belongs to arolec/sto> Unies you aecly nee to use this method there seems te pont inactivating the RoleManage or your neanet it, 4 rmplementing Customers Aco Houeht Io ASP.NET Coe Fis Migrations With ASP NET Web Pages Stes DP b Pages (artcleShmplementin-cusomers. Vale? 17/code-stmigraions wih aspsnetowe alecchoughionasenetcb-pages) sagestesl You might also lke.. Sept a 12 Comments (08 August 201307:27 -Glenn Walker ‘one aveton, Aen Windows thereon check in IS onfguation onthe sar oe this fec any othr enablehed stron that ane? (08 August 2018 07:36-Mike Aahanieion'scntged ona sty seas, Chesngan auhentation meester ae ste doer fee sting ter ses | (08 August 2013 08:25 -Glenn Walker ‘o\n Windows textures on oot the slactonjustrovdes the scope for indvaualwesteste allow enabling! Vandows Aunentcaton but has ec unless the (08 August 2013 10:53 -Mike hhipeuhwwr mikescoineting com/erce/2@hvindows-aubericalion-withasp-netweb-pages sis2017 Windows Authentication With ASPINET Web Pages ‘nats oe. nthe second age youre ap enbling the opon to ue Window thenetion foray ees hte on tat pacar te Boke Wt uncheck, 19 December 2013 07:54- Cogai am elatoel nto he tne es fp membeehip esd nat ple ernerenp ie suppareay MySQL ven aor pages eter ana cose or energy sesion arabes ‘oul to erowits 3 yt implement Simple Versarhp ls MysQlarven, Razor Wb Fags fnethow an we de 777 sm using Wistar 3 not al S| 20 December 2013 06:02- Mike Youn wit yout oun implementation of Warseshpiraider hat nett am EtendeaWerbershgerovde for NYS. You can mally copy the "Simpetemberengbrovaer cage atobe trom vee: aspnetebsackcoaep lence (onpiarpneorenntackcoaepoccm/Soureocontalstertesrlebitri ebbstasorpMembershpPrvsere ans enarge the SQ to work wth MSL (04 August 2014 12:04 fatima the ates vey help thank 17 September 2014 19:35 sunita ‘Thanks ie, tele vat spe and hb 411 August 2015 06:38 - ZishanaliTallor ‘awe know ation spas bude thn werd y Proving hs nd roe shot ou make ayo understan ts le Veryhepio users 25 January 2016 15:06- Bryon ‘as hoping ths woul Help sche the sues Im havig Then sane dates arden tas oa ld Razor ators ely mes with athens, 07 February 2016 03:11 -AlWilton Ine teen vig ths adie for qatea whe Today war setingupa.NET A: ste andi ove me aryl Ofer th anmner ix ele you know i! needa 388 toe wed cong adaserngs secon, 1 April 2016 02:01 - John Dave Bumatay 1h marked or mete mage thankyou very much ike!) (hupsrenitercomvintensliow? lowbuttonavarant=Oasereen.name-mikesdotnetting) (tps tps google comy100516357343781781689) (trtpztvvnanikesdcmnetingconveed) Sooner veraanstasaeney S NAUEREEEHHOd WAPAETZOVeHaRENMAoeIA ASNETSSYeneRaytanets) ISPNETSexnanaalrpnes 1S ner con veagonasasonacar) AS NETMNC egun/2aaspriane) ASPET WD Fors VEER REPO S sso sagesepeyzasoretetooge) © deorRedenestegenatoskresen) & Cesena) © Chien extgen/ieseass) © CSS Uesepey/sten) hhipeuhwwr mikescoineting com/erce/2@hvindows-aubericalion-withasp-net-web-pages sis2017 Windows Authentication With ASPINET Web Pages 1S eon ramenon vorgariennramenon) Etusvosegysteptig Erancon eed arpeysietenstonnchow) Gewrlleregay igre Sr veaeeeammnh BHMAS Keay ins MexShuepeeer/aoeashe) Jase vesernaseigy © Jey eaeey/2IaHeN) Sinovetesoyiiing W usm denegoitinsaces S Ruryereeryzeraen SLOUetegnibee) SOLYeteNye 1 ssene bigest vate Dialcenragrec YEN VeepeyaNba) VESeptleeganlaags) Mail Sudo Jeep 2eat Sweowivareenrnimoap) wbcravenenyaiimog) Weta enaROHARiM Recent Comments tu (aricraostreeelcentesteoteantsneryptecomments72} 0302/2017 48 Ineeporseo eS cere 6 it eShey| Thar sed WinSenpe for about st 9 nthe mors ges. Oneting tat you wane Tea Deer Vance 05/eestcaiates-nsthdetsncypoment6720} 0272/2017 324 Irripons fet cone Is th renege This ok ret you have commandline secs ta yoU Web server what abou these of us Cat. Varichsanarserverapptt-equialentnssp-netoretconmen i719) 06/1/2016 0543 Ireepars Ser Mop Fut SP MET ore Very scene and eas fll Wthas parte hast me fo me Tak Man) Kuacr ice 20a raewa cet doconten-updtedcarenen718) 04120160847 Sv Varese areworkoresraigrephfordsconnecedatatoniments8717) 19/0/20°6082" ineprs oy Fomena Cre rosropn for Dero Ds (mths very very very ice Thun fr he wie Nae, mach apreied frthe taking the Mark atl 06/xp ene pagesamer a aor pages omnenti715) 120/206 1642 Ineepose ASP NET nt Poge sc ano Pope sug eo ages war removes om the roadmap 35 jeter renamed aor Pages, Saya reat aenorcart ype orcad aohonnet6 12020160520 Julan (arteli0 sang spn coreimcavansson-aukatase rather doeaionteonmertbg72) 2609/2016 1627 IeeporsetoLoaang ase NT care Ms rem & Dota OF Ce oat Famaeie many mane Mal Hod go ha way Sow trad before nding or are ee Abo Roshaneai ric loading. cre rvs cn -etabae-r ther losin omen 1408/2016 0536 Irreporaet oane SPN! care Mes oma Boabse Grete aco Despre ASAE ts Pges at ars Paes Te got some rews As Daan tated ints Ink tps thu comlaspetMvresves/S208-We. Archives 2017 February 2 Vanlefarnive!2017/2) 2016 ‘tober (2) Yartiharehive/2016/°0) Sepcerber (1) Vartide/archve/2016/9) July @) lartictefareriver20167) Jane (1 Yarectorarchver2016/8) ‘May (1 aricevarenve/2018/5) ‘Apr Varcterarehive/20v6/4 March 2) Yarelearchive/2016/3) February (7) farlefarnie!20162) auary (2) Varsclevarchiver2016/1) 2015 ‘December (3) /artclearchive/2015/12) ‘october (3) Yartisarehive/2015/0), Seprerber (2) Varice/archive/2015/9) ‘agus 2) Vartic/arehive/2015/8) daly ariderarever2015/7) Jane 2} Yarederarchive/201S/5) ‘May 2) artiefarehive/2015/5) Apri Yarelerarehve/207s/ March (5) Yartteareive 20157) February (2) Varilerarenive!2015/2) ary Varveleforehiver2015!1) 2ora ‘october (2) Yarticharehver2014/0) ‘agus () Vartice/arenive/2014/8) daly 0 ardefareverzo14r7) hhipeuhwwr mikescoineting com/erce/2@hvindows-aubericalion-withasp-net-web-pages

You might also like