[prev in list] [next in list] [prev in thread] [next in thread]
List: grinder-use
Subject: [Grinder-use] Need little help
From: Suvendu_Mohapatra <Suvendu_mohapatra () satyam ! com>
Date: 2009-05-11 14:22:35
Message-ID: 5CE9F324F2296F4BB434A7D7A9E6DC2E0AFF97A6DB () hcsmbx002 ! corp ! satyam ! ad
[Download RAW message or body]
Hi,
Now I am trying to implement NTLM.java code which is doing all the \
authentication to the AuthorizationHandler interface of HTTPClient. The \
NTLMAuthoriZationHandler.java file contain following snippet code:
-------------------------------------------------------------------------------------- \
------------------------------------------------------------------------------------------------------------------------------------------------
public HTTPClient.AuthorizationInfo getAuthorization(HTTPClient.AuthorizationInfo \
parm1, HTTPClient.RoRequest parm2, HTTPClient.RoResponse parm3) throws \
HTTPClient.AuthSchemeNotImplException, java.io.IOException {
try {
String msg;
if(nonce != null)
msg = \
NTLM.formatResponse(user, password, host, domain, nonce); //type-3 message else
msg = \
NTLM.formatRequest(host, domain); //type-1 message
return new \
AuthorizationInfo(parm1.getHost(), parm1.getPort(), NTLM_TAG, "", msg); } \
catch(Exception ex) { ex.printStackTrace();
throw new IOException();
}
}
public HTTPClient.AuthorizationInfo fixupAuthInfo(HTTPClient.AuthorizationInfo parm1, \
HTTPClient.RoRequest parm2, HTTPClient.AuthorizationInfo parm3, HTTPClient.RoResponse \
parm4) throws HTTPClient.AuthSchemeNotImplException, java.io.IOException {
return parm1;
}
public void handleAuthHeaders(HTTPClient.Response parm1, HTTPClient.RoRequest parm2, \
HTTPClient.AuthorizationInfo parm3, HTTPClient.AuthorizationInfo parm4) throws \
java.io.IOException {
nonce = null;
try {
String challenge = \
parm1.getHeader(PROXY_AUTHENTICATE_HEADER);
if((challenge != null) && \
challenge.startsWith(NTLM_TAG) && challenge.length() > 4) nonce = \
NTLM.getNonce(challenge); //Extracting the server message from \
type-2 message
} catch(Exception ex) {
ex.printStackTrace();
}
}
public void handleAuthTrailers(HTTPClient.Response parm1, HTTPClient.RoRequest parm2, \
HTTPClient.AuthorizationInfo parm3, HTTPClient.AuthorizationInfo parm4) throws \
java.io.IOException {
}
-------------------------------------------------------------------------------------- \
------------------------------------------------------------------------------------------------------------------------------------------------------------
Is the above code fine?? As I am not getting the order of execution of \
HTTPClient.AuthorizationHandler class. This is what we deduced from commented \
information in Authorizationhandler class.
With Regards,
Suvendu
________________________________
DISCLAIMER:
This email (including any attachments) is intended for the sole use of the intended \
recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY \
INFORMATION. Any review or reliance by others or copying or distribution or \
forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If \
you are not the intended recipient, please contact the sender by email and delete all \
copies; your cooperation in this regard is appreciated.
[Attachment #3 (text/html)]
<html xmlns:v="urn:schemas-microsoft-com:vml" \
xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" \
xmlns="http://www.w3.org/TR/REC-html40"> <head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Helvetica;
panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
{font-family:Helvetica;
panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
{page:Section1;}
-->
</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="Section1">
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"> \
Now I am trying to implement NTLM.java code which is doing all the authentication to \
the AuthorizationHandler interface of HTTPClient.<o:p></o:p></p> <p \
class="MsoNormal">The NTLMAuthoriZationHandler.java file contain following snippet \
code:<o:p></o:p></p> <p \
class="MsoNormal">-------------------------------------------------------------------- \
-------------------------------------------------------------------------------------- \
----------------------------------------------------------------------------<o:p></o:p></p>
<p class="MsoNormal">public HTTPClient.AuthorizationInfo \
getAuthorization(HTTPClient.AuthorizationInfo parm1, HTTPClient.RoRequest parm2, \
HTTPClient.RoResponse parm3) throws HTTPClient.AuthSchemeNotImplException, \
java.io.IOException<o:p></o:p></p> <p \
class="MsoNormal"> \
{<o:p></o:p></p> <p class="MsoNormal"> \
\
try {<o:p></o:p></p> <p class="MsoNormal"> \
&n \
bsp; \
String msg;<o:p></o:p></p> <p class="MsoNormal"> \
&n \
bsp; \
if(nonce != null)<o:p></o:p></p> <p \
class="MsoNormal"> \
&n \
bsp; \
\
msg = NTLM.formatResponse(user, password, host, domain, nonce); \
//type-3 message<o:p></o:p></p> <p class="MsoNormal"> \
&n \
bsp; \
else<o:p></o:p></p> <p class="MsoNormal"> \
&n \
bsp; \
\
msg = NTLM.formatRequest(host, domain); //type-1 \
message<o:p></o:p></p> <p class="MsoNormal"> \
&n \
bsp; \
return new AuthorizationInfo(parm1.getHost(), parm1.getPort(), NTLM_TAG, \
"", msg);<o:p></o:p></p> <p class="MsoNormal"> \
\
} catch(Exception ex) {<o:p></o:p></p> <p \
class="MsoNormal"> \
&n \
bsp; \
ex.printStackTrace();<o:p></o:p></p> <p \
class="MsoNormal"> \
&n \
bsp; \
throw new IOException();<o:p></o:p></p> <p class="MsoNormal"> \
\
}<o:p></o:p></p> <p class="MsoNormal"> \
}<o:p></o:p></p> <p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">public HTTPClient.AuthorizationInfo \
fixupAuthInfo(HTTPClient.AuthorizationInfo parm1, HTTPClient.RoRequest parm2, \
HTTPClient.AuthorizationInfo parm3, HTTPClient.RoResponse parm4) throws \
HTTPClient.AuthSchemeNotImplException, java.io.IOException<o:p></o:p></p> <p \
class="MsoNormal"> \
{<o:p></o:p></p> <p class="MsoNormal"> \
\
return parm1;<o:p></o:p></p> <p \
class="MsoNormal"> \
}<o:p></o:p></p> <p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">public void handleAuthHeaders(HTTPClient.Response parm1, \
HTTPClient.RoRequest parm2, HTTPClient.AuthorizationInfo parm3, \
HTTPClient.AuthorizationInfo parm4) throws java.io.IOException<o:p></o:p></p> <p \
class="MsoNormal"> \
{<o:p></o:p></p> <p class="MsoNormal"> \
\
nonce = null;<o:p></o:p></p> <p class="MsoNormal"> \
\
try {<o:p></o:p></p> <p class="MsoNormal"> \
&n \
bsp; \
String challenge = parm1.getHeader(PROXY_AUTHENTICATE_HEADER);<o:p></o:p></p> <p \
class="MsoNormal"> &n \
bsp; &nbs \
p; \
if((challenge != null) && challenge.startsWith(NTLM_TAG) && \
challenge.length() > 4)<o:p></o:p></p> <p \
class="MsoNormal"> \
&n \
bsp; \
\
nonce = NTLM.getNonce(challenge); \
//Extracting the server message from type-2 message<o:p></o:p></p> <p \
class="MsoNormal"> \
&n \
bsp; \
<o:p></o:p></p> <p class="MsoNormal"> \
\
} catch(Exception ex) {<o:p></o:p></p> <p \
class="MsoNormal"> \
&n \
bsp; \
ex.printStackTrace();<o:p></o:p></p> <p class="MsoNormal"> \
\
}<o:p></o:p></p> <p class="MsoNormal"> \
}<o:p></o:p></p> <p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">public void handleAuthTrailers(HTTPClient.Response parm1, \
HTTPClient.RoRequest parm2, HTTPClient.AuthorizationInfo parm3, \
HTTPClient.AuthorizationInfo parm4) throws java.io.IOException<o:p></o:p></p> <p \
class="MsoNormal"> \
{<o:p></o:p></p> <p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"> \
}<o:p></o:p></p> <p class="MsoNormal">------------------------------------------------ \
-------------------------------------------------------------------------------------- \
------------------------------------------------------------------------------------------------------------<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Is the above code fine?? As I am not getting the order of \
execution of HTTPClient.AuthorizationHandler class. This is what we deduced from \
commented information in Authorizationhandler class.<o:p></o:p></p> <p \
class="MsoNormal"><o:p> </o:p></p> <p class="MsoNormal"><span \
style="font-size:10.0pt;font-family:"Helvetica","sans-serif"; \
color:navy">With Regards,</span><span \
style="font-size:10.0pt;font-family:"Arial","sans-serif"; \
color:#1F497D">   \
; & \
nbsp; &nb \
sp;   \
; & \
nbsp;
</span><span style="font-size:10.0pt;font-family:"Arial","sans-serif";
color:black"><br>
</span><b><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif";
color:navy">Suvendu<br>
<br>
</span></b><span style="font-size:10.0pt;font-family:"Helvetica","sans-serif";
color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<br>
<hr>
<font face="Arial" color="Navy" size="2">DISCLAIMER:<br>
This email (including any attachments) is intended for the sole use of the intended \
recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY \
INFORMATION. Any review or reliance by others or copying or distribution or \
forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If \
you are not the intended recipient, please contact the sender by email and delete all \
copies; your cooperation in this regard is appreciated.<br> </font>
</body>
</html>
[Attachment #4 (--===============5446841056732671132==)]
------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
grinder-use mailing list
grinder-use@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/grinder-use
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic