Quantcast
Channel: West Wind Message Board Messages
Viewing all articles
Browse latest Browse all 10393

Basic authentication with 5.43

$
0
0
Basic authentication with 5.43
Web Connection 5.0
Basic authentication with 5.43
Nov. 14, 2012
05:26 am
3N70BNL5OShow this entire thread in new window
Gratar Image based on email address
From:Rick Steinwand
To:All
I use Fiddler2 a lot and use Basic Authentication to assess certain features of our Intranet. Fiddler always complains about the missing content length header so I decided to try adding it.

The addition of one line seems to have fixed it (or at least the error went away):

*************************************************************DEFINECLASS wwPageResponse AS RELATION************************************************************* *********************************************************************FUNCTION BasicAuthentication(tcRealm, tcErrorText)************************************************** tcRealm = IIF(VARTYPE(tcRealm)="C",tcRealm,"") tcErrorText = IIF(VARTYPE(tcErrorText)="C",tcErrorText,;"<html><body><h1>Access to this page is denied</h1><hr>"+CR+;"Please enter a valid username and password to access this page.</body></html>")THIS.Clear()this.ContentType="text/html"this.Status = "401 Not Authorized"this.Headers.Add("WWW-Authenticate", [basic realm="] + tcRealm + ["])this.Headers.Add("Content-Length", TRANSFORM(LEN(tcErrorText)))IF !EMPTY(tcErrorText)this.FastWrite(tcErrorText)ENDIFTHIS.End()ENDFUNC

There's similar code in wwhttpheader and wwscripting, which I do not use, and was not able to test so will not post that fix unless requested.

Thanks Rick.


Viewing all articles
Browse latest Browse all 10393

Trending Articles