Home
%3CLINGO-SUB%20id%3D%22lingo-sub-916043%22%20slang%3D%22en-US%22%3ERequest%20based%20versus%20Session%20based%20Kerberos%20Authentication%20(or%20the%20AuthPersistNonNTLM%20parameter)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-916043%22%20slang%3D%22en-US%22%3E%3CP%3EIn%20this%20article%2C%20we%20will%20discuss%20how%20the%20AuthPersistNonNTLM%20authentication%20attribute%20affects%20Kerberos%20authentication%20to%20become%20a%20session%20or%20request%20based%20authentication%20protocol.%20Thus%2C%20we%20will%20be%20addressing%20below%20questions%3A%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3EWhat%20is%20the%20purpose%20of%20the%20AuthPersistNonNTLM%20attribute%3F%3C%2FLI%3E%0A%3CLI%3EHow%20to%20change%20AuthPersistNonNTLM%20setting%20to%20True%2FFalse%3F%3C%2FLI%3E%0A%3CLI%3EHow%20to%20test%20if%20the%20Kerberos%20authentication%20is%20session%20or%20request%20based%3F%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%23800000%22%3E%3CSTRONG%3EWhat%20is%20the%20purpose%20AuthPersistNonNTLM%20attribute%3F%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3EAuthPersistNonNTLM%20attribute%20has%20a%20significant%20role%20on%20controlling%20Kerberos%20authentication%20behaviour.%20When%20this%20attribute%20is%20set%20to%20False%2C%20it%20converts%20the%20authentication%20from%20Session%20based%20to%20Request%20based%20which%20means%20%26nbsp%3Bthat%20your%20client%20needs%20to%20send%20the%20authentication%20ticket%20with%20every%20single%20request%20to%20your%20IIS%20server%20even%20after%20it%20gets%20authenticated%20and%20authorized%20for%20the%20first%20request.%20On%20the%20other%20hand%2C%20Session%20based%20Kerberos%20authentication%2C%20gives%20the%20privilege%20to%20your%20client%20to%20send%20the%20authentication%20ticket%20only%20with%20the%20first%20request%20after%20getting%20authenticated%20and%20provided%20by%20the%20ticket.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CP%3EHaving%20a%20look%20on%20below%20%3CSTRONG%3ERequest-Based%3C%2FSTRONG%3E%20Kerberos%20Authentication%20graph%2C%20you%20can%20see%20that%20in%20step%205%2C%20where%20the%20client%20makes%20the%20second%20HTTP%20request%20(request2.aspx)%2C%20it%20will%20still%20needs%20to%20send%20the%20Kerberos%20ticket%20to%20the%20server%20in%20order%20to%20get%20the%20desired%20content%2C%20and%20this%20would%20apply%20on%20request3%2C%20request4%20..%20and%20so%20on.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20624px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F137699iDCDC693F02168544%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image.png%22%20title%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOn%20the%20other%20hand%2C%20as%20you%20may%20notice%20within%20below%20%3CSTRONG%3ESession-Based%3C%2FSTRONG%3E%20Kerberos%20Authentication%2C%20Request2.aspx%2C%20does%20not%20contain%20the%20Kerberos%20ticket%20anymore%20and%20no%20further%20authentication%20is%20required%20as%20long%20as%20the%20client%20is%20using%20the%20same%20TCP%20connection%20on%20which%20the%20HTTP%20requests%20are%20sent%20and%20the%20responses%20are%20received%20(the%20reuse%20of%20a%20TCP%20connection%20for%20multiple%20http%20requests%20is%20also%20called%20http%20keep%20alive).%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20695px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F137700i090F2D42E3AA03D7%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image.png%22%20title%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CFONT%20color%3D%22%23800000%22%3EWhy%20is%20this%20distinction%20important%3F%3C%2FFONT%3E%20%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3ERequest-based%20authentication%20may%20cause%20a%20heavy%20load%20on%20traffic%20between%20your%20client%20and%20IIS%20server%20(where%20your%20application%20lives).%20This%20is%20because%20the%20Kerberos%20tickets%20tend%20to%20be%20rather%20large%2C%20several%20kile-bytes%20in%20size%2C%20whereas%20a%20simple%20GET%20request%20is%20only%20several%20hundred%20bytes%20in%20size%20%E2%80%93%20thus%20we%20increase%20the%20size%20of%20all%20outgoing%20requests%20by%20a%20large%20factor%20in%20request%20based%20Kerberos%20Authentication.%20On%20the%20server%20side%2C%20we%20have%20to%20perform%20the%20decryption%20of%20the%20ticket%20and%20the%20authentication%20phase%20again%20and%20again%20for%20each%20request%2C%20which%20can%20again%20cause%20a%20small%20performance%20hit.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%23800000%22%3E%3CSTRONG%3EHow%20to%20change%20AuthPersistNonNTLM%20setting%20to%20True%2C%20to%20make%20Windows%20Authentication%20Session-Based%3F%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3EInitially%2C%20we%20need%20to%20Enable%20Windows%20Authentication%20module%20on%20Server%20or%20Site%20level%2C%20whatever%20you%20decide.%20This%20can%20be%20done%20by%20following%20below%20steps%3A%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E%3CSTRONG%3ENote%3A%20Applying%20below%20steps%20on%20server%20level%2C%20means%20that%20you%20have%20decided%20to%20involve%20ALL%20application%20hosted%20on%20this%20IIS%20server.%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3EClick%20on%20Server%20or%20Application%20node.%3C%2FLI%3E%0A%3CLI%3EDouble%20click%20on%20Authentication%20module%20under%20IIS%20pane%3A%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20624px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F137702iB97A2F325C3CFA6E%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image.png%22%20title%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3EEnable%20Windows%20Authentication%3A%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20461px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F137703iBC17BB6880F103E1%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image.png%22%20title%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3ENow%20that%20we%20have%20Windows%20authentication%20enabled%2C%20there%20are%202%20ways%20to%20manage%20AuthPersistNonNTLM%20attribute%3A%3C%2FP%3E%0A%3CP%3E%3CBR%20%2F%3EFirst%20one%20and%20the%20%3CSTRONG%3Erecommended%20one%3C%2FSTRONG%3E%2C%20is%20to%20use%20%3CSTRONG%3EConfiguration%20Editor%3C%2FSTRONG%3E%20on%20Application%20or%20Server%20level%3A%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3ESelect%20Server%20or%20Site%20node%20and%20go%20to%20%3CSTRONG%3EConfiguration%20Editor%3C%2FSTRONG%3E%20under%20%3CSTRONG%3EManagement%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3CLI%3ENavigate%20to%20%3CSTRONG%3E%3CU%3EwebServer%2Fsecurity%2Fauthentication%2FwindowsAuthentication%3C%2FU%3E%3C%2FSTRONG%3E%2C%20and%20set%20authPersistNonNTLM%20to%20True%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E%3CSTRONG%3ENote%3A%20You%20will%20notice%20that%2C%20AuthPersistNonNTLM%20is%20set%20to%20false%20by%20default%20on%20Windows%202008%20SP2%20and%20Windows%202008%20R2%20servers.%20In%20other%20words%2C%3CBR%20%2F%3EKerberos%20authentication%20is%20a%20request%20based%20by%20default.%20Starting%20from%20Windows%202012%20R2%20servers%20onwards%2C%20the%20default%20value%20is%20true.%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorclipboard_image_0%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20624px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F137704iB23FE4F3CF79753F%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image.png%22%20title%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EThe%20second%20way%20to%20manage%20AuthPersistNonNTLM%20attribute%2C%20is%20to%20go%20directly%20to%20your%20web%20or%20ApplicationHost%20config%20files%20as%20shown%20below%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%3CSYSTEM.WEBSERVER%3E%0A%20%20%20%20%20%20%3CSECURITY%3E%0A%20%20%20%20%20%20%20%20%3CAUTHENTICATION%3E%0A%20%20%20%20%20%20%20%20%20%20%3CWINDOWSAUTHENTICATION%20enabled%3D%22true%22%20authpersistsinglerequest%3D%22false%22%20authpersistnonntlm%3D%22true%22%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3CPROVIDERS%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CCLEAR%3E%3C%2FCLEAR%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CADD%20value%3D%22NTLM%22%3E%3C%2FADD%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3CADD%20value%3D%22Negotiate%22%3E%3C%2FADD%3E%0A%20%20%20%20%20%20%20%20%20%20%20%20%3C%2FPROVIDERS%3E%0A%20%20%20%20%20%20%20%20%20%20%3C%2FWINDOWSAUTHENTICATION%3E%0A%20%20%20%20%20%20%20%20%20%20%3CBASICAUTHENTICATION%20enabled%3D%22true%22%3E%3C%2FBASICAUTHENTICATION%3E%0A%20%20%20%20%20%20%20%20%20%20%3CANONYMOUSAUTHENTICATION%20enabled%3D%22false%22%3E%3C%2FANONYMOUSAUTHENTICATION%3E%0A%20%20%20%20%20%20%20%20%3C%2FAUTHENTICATION%3E%0A%20%20%20%20%20%20%3C%2FSECURITY%3E%0A%3C%2FSYSTEM.WEBSERVER%3E%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENow%20that%20we%20have%20addressed%20first%20two%20questions%2C%20we%20aimed%20to%20answer%20within%20this%20article%2C%20It%20is%20time%20to%20have%20a%20real-life%20example%20on%20%3CSTRONG%3Ehow%20to%20test%20if%20the%20Kerberos%20authentication%20is%20session%20or%20request%20based%3F%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CP%3EFor%20similar%20cases%20scenarios%2C%20when%20we%20need%20to%20check%20or%20troubleshoot%20the%20http%20network%20traffic%20between%20client%20and%20server%2C%20we%20use%20an%20excellent%20tool%20called%20NetMon%20short%20for%20Network%20Monitor%2C%20you%20can%20install%20it%20from%20%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fnam06.safelinks.protection.outlook.com%2F%3Furl%3Dhttp%253A%252F%252Flinqto.me%252FNetmon%26amp%3Bdata%3D02%257C01%257Ca-moalha%2540microsoft.com%257C86def9b47b3c4a1470e208d6bc20cb93%257C72f988bf86f141af91ab2d7cd011db47%257C1%257C0%257C636903246373405198%26amp%3Bsdata%3DxoI33An%252B1gk1WV2ssj90SErGQLxAZFFMuvN3fikqBHg%253D%26amp%3Breserved%3D0%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Flinqto.me%2FNetmon%3C%2FA%3E%3C%2FSPAN%3E%20%2C%20and%20to%20have%20more%20insight%20on%20how%20to%20use%20it%2C%20you%20may%20follow%20instructions%20within%20this%20%3CSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fwindows%2Fclient-management%2Ftroubleshoot-tcpip-netmon%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Earticle%3C%2FA%3E%3C%2FSPAN%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%23800000%22%3E%3CSTRONG%3EKerberos%20Authentication%20sample%3C%2FSTRONG%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3ELooking%20at%20below%20screenshot%20taken%20from%20a%20Netmon%20trace%20for%20a%20regular%20Kerberos%20authentication%20traffic%2C%20which%20started%20with%20Client%20requesting%20%3CSTRONG%3E%3CU%3E%2Fwhoami.aspx%3C%2FU%3E%3C%2FSTRONG%3E%20page%2C%20and%20server%20responded%20with%20401%2C%20Unauthorized%20(this%20is%20normal%2C%20since%20the%20browser%20starts%20by%20making%20an%20anonymous%20request%20to%20the%20server%20at%20first)%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20624px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F137705i99BE6DED855E511B%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image.png%22%20title%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20624px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F137706i015F37677A18B9E5%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image.png%22%20title%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EIn%20the%20response%2C%20the%20server%20also%20provides%20the%20supported%20authentication%20methods%20via%20the%20WWWAuthenticate%20header%2C%20which%20in%20this%20case%20indicate%20that%20both%20Negotiate%20and%20NTLM%20are%20supported.%20In%20light%20of%20this%2C%20the%20client%20attempts%20another%20request%20providing%20the%20Authorization%20token%20(the%20Kerberos%20ticket)%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20624px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F137707i26B574C81F49010C%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image.png%22%20title%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CFONT%20size%3D%221%202%203%204%205%206%207%22%3E%3CSTRONG%3ENote%20that%20on%20the%20case%20of%20Kerberos%2C%20the%20tickets%20will%20always%20start%20with%20a%20YII%3C%2FSTRONG%3E%20prefix.%3C%2FFONT%3E%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20server%20processes%20the%20request%2C%20decrypts%20the%20ticket%20and%20validates%20it.%20If%20the%20authentication%20is%20successful%2C%20it%20responds%20with%20a%20200%20status%20code%2C%20like%20the%20below.%20It%20also%20includes%20a%20validation%20token%20so%20that%20the%20client%20can%20also%20validate%20the%20identity%20of%20the%20server.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20624px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F137708iB0E625617A4447B2%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image.png%22%20title%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20of%20this%20point%2C%20we%20were%20only%20pointing%20to%20a%20regular%20Client-Server%20negotiation%20process%20which%20typically%20applies%20for%20both%20Request%20and%20Session%20based%20Kerberos%20authentication.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EHow%20should%20traffic%20show%20for%20%3C%2FSTRONG%3E%3CSTRONG%3ERequest-based%20Kerberos%20authentication%3F%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20624px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F137710i2C1BA7268D67C667%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image.png%22%20title%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20624px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F137711i60D41F2FEAC1B8D4%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image.png%22%20title%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EAs%20you%20may%20notice%2C%20event%202%3CSUP%3End%3C%2FSUP%3E%20and%203%3CSUP%3Erd%3C%2FSUP%3E%20requests%20were%20still%20in%20a%20need%20to%20provide%20Kerberos%20tickets%20and%20the%20Authentication%20from%20server%20side%20was%20still%20needed%20for%20every%20request%20although%20we%20are%20using%20the%20same%20TCP%20connection%20between%20the%20client%20and%20the%20server.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EHow%20about%20Kerberos%20Session-based%20traffic%3F%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EIn%20this%20screenshot%20of%20a%20Network%20trace%20captured%20for%20same%20exact%20above%20requests%20but%20this%20time%20for%20Session-based%20Kerberos%20authentication%20setup%2C%20where%20you%20can%20easily%20notice%20that%20Kerberos%20ticket%20was%20not%20being%20sent%20anymore%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20624px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F137712iECE8D874243AC312%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image.png%22%20title%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20624px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F137713iCADCDDBBA9CBEB67%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image.png%22%20title%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3ENotice%20that%20the%20response%20from%20the%20server%2C%20on%20the%20first%20request%20that%20contains%20the%20authentication%20ticket%20also%20contains%20an%20Http-Header%20called%20Persistent-Auth%20and%20which%20has%20its%20value%20set%20to%20true.%20This%20header%20indicates%20to%20the%20client%20that%20the%20server%20is%20willing%20and%20able%20to%20use%20session-based%20Kerberos%20authentication%20on%20this%20TCP%20connection%20and%20there%20is%20no%20need%20to%20resend%20the%20Kerberos%20ticket%20with%20subsequent%20requests%3A%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20624px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F137714iCA6D4842BD60DD15%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22image.png%22%20title%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3Ewritten%20by%3A%20Muna%20AlHasan%3CBR%20%2F%3Ereviewed%20by%3A%20%3CA%20href%3D%22http%3A%2F%2Flinqto.me%2Fabout%2Fpcociuba%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EPaul%20Cociuba%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-916043%22%20slang%3D%22en-US%22%3E%3CP%3EIn%20this%20article%2C%20we%20will%20discuss%20how%20the%20AuthPersistNonNTLM%20authentication%20attribute%20affects%20Kerberos%20authentication%20to%20become%20a%20session%20or%20request%20based%20authentication%20protocol.%20Thus%2C%20we%20will%20be%20addressing%20below%20questions%3A%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3EWhat%20is%20the%20purpose%20of%20the%20AuthPersistNonNTLM%20attribute%3F%3C%2FLI%3E%0A%3CLI%3EHow%20to%20change%20AuthPersistNonNTLM%20setting%20to%20True%2FFalse%3F%3C%2FLI%3E%0A%3CLI%3EHow%20to%20test%20if%20the%20Kerberos%20authentication%20is%20session%20or%20request%20based%3F%3C%2FLI%3E%0A%3C%2FOL%3E%3C%2FLINGO-TEASER%3E
Microsoft

In this article, we will discuss how the AuthPersistNonNTLM authentication attribute affects Kerberos authentication to become a session or request based authentication protocol. Thus, we will be addressing below questions:

  1. What is the purpose of the AuthPersistNonNTLM attribute?
  2. How to change AuthPersistNonNTLM setting to True/False?
  3. How to test if the Kerberos authentication is session or request based?

 

What is the purpose AuthPersistNonNTLM attribute?

AuthPersistNonNTLM attribute has a significant role on controlling Kerberos authentication behaviour. When this attribute is set to False, it converts the authentication from Session based to Request based which means  that your client needs to send the authentication ticket with every single request to your IIS server even after it gets authenticated and authorized for the first request. On the other hand, Session based Kerberos authentication, gives the privilege to your client to send the authentication ticket only with the first request after getting authenticated and provided by the ticket.

Having a look on below Request-Based Kerberos Authentication graph, you can see that in step 5, where the client makes the second HTTP request (request2.aspx), it will still needs to send the Kerberos ticket to the server in order to get the desired content, and this would apply on request3, request4 .. and so on.

 

image.png

 

On the other hand, as you may notice within below Session-Based Kerberos Authentication, Request2.aspx, does not contain the Kerberos ticket anymore and no further authentication is required as long as the client is using the same TCP connection on which the HTTP requests are sent and the responses are received (the reuse of a TCP connection for multiple http requests is also called http keep alive).

 

image.png

 

Why is this distinction important?

Request-based authentication may cause a heavy load on traffic between your client and IIS server (where your application lives). This is because the Kerberos tickets tend to be rather large, several kile-bytes in size, whereas a simple GET request is only several hundred bytes in size – thus we increase the size of all outgoing requests by a large factor in request based Kerberos Authentication. On the server side, we have to perform the decryption of the ticket and the authentication phase again and again for each request, which can again cause a small performance hit.

 

How to change AuthPersistNonNTLM setting to True, to make Windows Authentication Session-Based?

Initially, we need to Enable Windows Authentication module on Server or Site level, whatever you decide. This can be done by following below steps:

Note: Applying below steps on server level, means that you have decided to involve ALL application hosted on this IIS server.

  1. Click on Server or Application node.
  2. Double click on Authentication module under IIS pane:
    image.png
  3. Enable Windows Authentication:
    image.png

Now that we have Windows authentication enabled, there are 2 ways to manage AuthPersistNonNTLM attribute:


First one and the recommended one, is to use Configuration Editor on Application or Server level:

  1. Select Server or Site node and go to Configuration Editor under Management
  2. Navigate to webServer/security/authentication/windowsAuthentication, and set authPersistNonNTLM to True

Note: You will notice that, AuthPersistNonNTLM is set to false by default on Windows 2008 SP2 and Windows 2008 R2 servers. In other words,
Kerberos authentication is a request based by default. Starting from Windows 2012 R2 servers onwards, the default value is true.

 

image.png

The second way to manage AuthPersistNonNTLM attribute, is to go directly to your web or ApplicationHost config files as shown below:

 

<system.webServer>
      <security>
        <authentication>
          <windowsAuthentication enabled="true" authPersistSingleRequest="false" authPersistNonNTLM="true">
            <providers>
              <clear />
              <add value="NTLM" />
              <add value="Negotiate" />
            </providers>
          </windowsAuthentication>
          <basicAuthentication enabled="true" />
          <anonymousAuthentication enabled="false" />
        </authentication>
      </security>
</system.webServer>

 

Now that we have addressed first two questions, we aimed to answer within this article, It is time to have a real-life example on how to test if the Kerberos authentication is session or request based?

For similar cases scenarios, when we need to check or troubleshoot the http network traffic between client and server, we use an excellent tool called NetMon short for Network Monitor, you can install it from http://linqto.me/Netmon , and to have more insight on how to use it, you may follow instructions within this article.

 

Kerberos Authentication sample

Looking at below screenshot taken from a Netmon trace for a regular Kerberos authentication traffic, which started with Client requesting /whoami.aspx page, and server responded with 401, Unauthorized (this is normal, since the browser starts by making an anonymous request to the server at first):

 

image.png

 

image.png

In the response, the server also provides the supported authentication methods via the WWWAuthenticate header, which in this case indicate that both Negotiate and NTLM are supported. In light of this, the client attempts another request providing the Authorization token (the Kerberos ticket):

 

image.png

Note that on the case of Kerberos, the tickets will always start with a YII prefix.

The server processes the request, decrypts the ticket and validates it. If the authentication is successful, it responds with a 200 status code, like the below. It also includes a validation token so that the client can also validate the identity of the server.

image.png

 

As of this point, we were only pointing to a regular Client-Server negotiation process which typically applies for both Request and Session based Kerberos authentication.

 

How should traffic show for Request-based Kerberos authentication?

 

image.png

image.png

As you may notice, event 2nd and 3rd requests were still in a need to provide Kerberos tickets and the Authentication from server side was still needed for every request although we are using the same TCP connection between the client and the server.

 

How about Kerberos Session-based traffic?

In this screenshot of a Network trace captured for same exact above requests but this time for Session-based Kerberos authentication setup, where you can easily notice that Kerberos ticket was not being sent anymore:

 

image.png

image.png

Notice that the response from the server, on the first request that contains the authentication ticket also contains an Http-Header called Persistent-Auth and which has its value set to true. This header indicates to the client that the server is willing and able to use session-based Kerberos authentication on this TCP connection and there is no need to resend the Kerberos ticket with subsequent requests:
image.png

 

written by: Muna AlHasan
reviewed by: Paul Cociuba