POST request in a login script
I have a strange problem when the variables that are passed to a PHP script dont get recognized in an equal statement. The java code :
tring value, value2;
try {
BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
URL url = new URL("................./admin.php");
URLConnection connection = url.openConnection();
connection.setDoOutput(true);
System.out.println("Enter your username");
value = stdin.readLine();
value = URLEncoder.encode(value, "UTF-8");
System.out.println("Enter your password");
value2 = stdin.readLine();
value2 = URLEncoder.encode(value2, "UTF-8");
System.out.println("Acessing the ECHO server script");
PrintWriter out = new PrintWriter(connection.getOutputStream());
out.println("username="+ value);
out.println("&password="+value2);
out.close();
BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
String inputLine;
System.out.println("Retrieving data");
System.out.println("");
while ((inputLine = in.readLine()) != null)
System.out.println(inputLine);
System.out.println("");
in.close();
catch (Exception e)
System.out.println("Error: "+e);
System.out.println("Processing Acomplished");In case somebody wonders, this is part of the php script
if (isset($_POST['username']) && isset($_POST['password']))
$username = $_POST['username'];
$password = $_POST['password'];
echo $username;
echo $password;
if ( $username == "1" && $password == "2" )
echo "CORRECT";
else
echo "INCORRECT";
}Now, the script successfuly recieved my data, and prints it back. However, whenever i try to check if the value is "1", for example, it always evaluates to FALSE. I am completely lost, because the script print back 1, and then says that 1 != 1
I know it looks like script problem, but im almost sure that its not.
Maybe the data that java post's is encoded differently or something, and the script cant really "interpret" it. Did anyone else encounter any problems with login scripts and java ?
Sorry if this is a lame question, i'm just beginning....
I know it looks like script problem, but im almost sure that its not.I'm almost sure it is. Check that it's not comparing the string "1" to the integer 1 or something. But the way you present it the problem is almost certainly in the PHP rather than the Java.
Similar Messages
-
Hello and I hope that everyone is having a great weekend. I noticed an issue with a login script that I have been using for a number of years, the issue only seems to crop up on the SLED 11 SP1 Desktop and the NCL, on my Windows 7 machine the login script works fine under Windows 7 here is the script that I am using
MAP R U:="%HOME_DIRECTORY"
Again the script works on Win 7, but not on SLED 11 SP1, and NCLOriginally Posted by jmarton
dschaldemcs wrote:
> It is ignoring the Home Directory statement
Are you using any if/then statements around the "map r U:..." that
might cause it to not execute on SLED?
If not, next thing is check the client properties as I thought there
were some settings for variables or something in there... can't
remember for sure and I no longer have SLED around to test.
Novell Knowledge Partner
Enhancement Requests: http://www.novell.com/rms
I ended up using a variation of the following MAP R H:=servername\data volume name\HOME\then user ID that worked for my own user I will be testing that for others as well on the SLED 11 and make sure that they will work also. -
I am trying to set up bluetooth on the Centro to connect to the internet via my PC's internet.
HotSync over bluetooth works successfully.
Computer specs: Toshiba P205-S6277; Bluetooth Stack v5.10.04 (currently using); Bluetooth Monitor v3.01 (to use Vista's built-in bluetooth)
I think I have narrowed my problem down to 3 things.
(1) Finding Network Access properties (to allow connected devices to access the internet)
(2) Finding Centro's Network Connection Type: PPP
(3) Finding the correct Login Script to use
for (1) I think I've looked everywhere; found nothing on Network Access.
Checked control panel: only Bluetooth Local COM
Right-clicked bluetooth icon > Settings: File transfer, PAN Networking, PAN DHCP server, AV controls. Other bluetooth settings are for file transfer or object push. I don't see anything like this.
I'm stumped on (2). It seems as if palm removed this option under Centro's Advanced network settings .
Nearly all the forums that I read says to choose Connection Type: PPP.
(3) Found 2 scripts that seemed would work. I don't know how it exactly works but it sounds workable.
First script:
Send: CLIENT
Send: CLIENT
Wait for: CLIENTSERVER
End:
Script 1 Connect Log:
=======================================
Connect Log
S: client
S: client
R:
Err: 0x121F <<<netErrUserCancel b/c I canceled it.
Not connected
========================================
I canceled it because the process would stay on "Signing In" then it automatically "Canceled" itself.
Second script:
Send CR:
Delay: 1
Send: CLIENT
Wait For: CLIENTSERVER
End
**UPDATE** I found on this forum (Reply # 3689) that the script is needed only if you are using Palm OS 4 or under. Centro uses Palm OS 5.49121. Can anyone support this?
Even without the script it has problems "Signing In".
I'm currently reading this site and trying out its decribed methods. I will update this thread when I get the results.
I'm using the Centro. And If anyone's been able to successfully connect to the internet on the Centro via a bluetooth connection to the PC WITHOUT 3rd party applications, please share. If not, please share any ideas.
Thanks!
-Eric
Post relates to: Centro (AT&T)
Message Edited by naisanza on 01-01-2009 02:26 PMI've been going at this for days, and have probably exhausted all the proposed solutions on the first 3 pages of various google searches. I'm getting the feeling that Vista users are pretty much SOL for the time being.
For the record, I just tried out a few of the solutions (mRouter & SoftickPPP) on XP and they work perfectly.
Post relates to: Centro (Verizon)
Message Edited by Cogwheel on 02-13-2009 09:45 AM -
Retrieve data/files fro HTTP POST request in On-Demand process
Hello,
I would like to integrate https://github.com/blueimp/jQuery-File-Upload to my APEX 4.2 application inside XE11g. I would like to use this kind of jQuery component, multiple file upload, use Drag & Drop, image resize, size limit, filter extensions etc...
This jQuery component and also others javascript uploaders sends data files to some defined URL. Developer need to build some servlet, php script or something on server side that will read files from HTTP request and stores it somewhere.
Do you know how to do it in APEX? How can I read data from HTTP POST request in PL/SQL? Now I can only call my On-Demand application process from javascript, but I am not able to read any data from HTTP POST in it.
Can I do it in APEX, or using MOD_PLSQL?
I would like to implement this:
1) some javascript uploader will call some URL of my application and sends HTTP POST with data files
2) I will read data files from HTTP POST and store them into database
3) I will create some HTTP response for javascript uploader
Thank you for some tipsI know about that existing plugin " Item Plugin - Multiple File Upload"
But I doesn't work in IE and has only basic features. Licence for commercial use is also needed. I would like to use some existing jQuery plugin. There are many of these plugins with nice features. And only one problem is that I need to create some server side process/servlet/script.. that can recieve HTTP request, get files from it and stores them into DB. -
Greetings everybody,
For this particular question I am not getting any help from the Java forums and Google.
Not very long ago I had to send a stream of bytes from an applet to a servlet (the applet and its helper classes are packed inside a signed jar file), but I used to fail miserably at every step.
I tried every trick in the book (for me the books were Google and Java forums!!). I set the servlet's path in the Windows CLASSPATH, I tried to call the applet from within a servlet- of course after placing the applet file in the servlets folder- (in the hope that since the applet was in the same location as the servlets the URL would get established) e.t.c but still URL url=new URL(<servlet URL>) refused to invoke the servlet.
Finally somehow I managed to get it done using the code below:
public class Xyz extends Applet
//DONT BE SURPRISED RIGHT NOW!!
Class cls=this.getClass();
ClassLoader cldr=cls.getClassLoader();
//THE ACTUAL SERVLET CONNECTING CODE
URL url=cldr.getResource("http://localhost:8000/servlet/<SomeServlet>");
/*This statement does not work........ URL url=new URL("http://localhost:8000/servlet/<SomeServlet>").A NULL URL OBJECT GETS CREATED!! */
HttpURLConnection hurlc=(HttpURLConnection)url.getConnection();
//ALL THE NECESSARY FORMALITIES TO BE PERFORMED TO WRITE THE STREAM TO THE SERVLET
hurlc.setDoInput(false);
hurlc.setDoOutput(true);
hurlc.setUseCaches(false);
hurlc.setRequestMethod("POST");
OutputStream os=hurlc.getOutputStream();
//WRITING THE STREAM
os.write(<some byte buffer>);
//NOW COMES THE TRICKY PART
hurlc.getResponseCode();
I had to do getResponseCode() because once ClassLoader.getResource(<servlet URL>) invoked the servlet using the GET method I COULD NOT INVOKE THE SERVLET AGAIN. I had to force an invokation using getResponseCode().
Well all is well now excepting for a small irritant. Instead of issuing one POST request the URLConnection is issuing multiple POST requests. In the Apache logs I get to see something like:
GET /snodx/callapplet.htm 200 116
GET /snodx/keystore_for_holding_fingerprint_for_trusted_applet 200 234
GET /snodx/applet_and_helpers.jar 200 105
HEAD /servlet/<SomeServlet> 200 187
POST /servlet/<SomeServlet> 200 312
POST /servlet/<SomeServlet> 500 604
POST /servlet/<SomeServlet> 500 604
The last 2 lines indicate that the servlet was invoked but the connection closed somehow. This is confirmed by taking a look at the Apache error logs:
Premature end of script headers.
Premature end of script headers.
In the JServ servlet engine error logs I am getting:
(500)apj12 returned an error handling request
cannot scan servlet headers.
The problem is occurring somewhere in getResponseCode().This statement is invoking the servlet using the request method set (POST) several times (2 or 3 times).
Can someone explain what's going on?
This is briefly the servlet code:
public class SomeServlet extends HttpServlet
//THE SERVICE METHOD IS CALLED BY A HEAD REQUEST TO THIS SERVLET
public void service(ServletRequest reque,ServletResponse respon) throws ServletException,IOException
this.doPost((HttpServletResponse)reque,(HttpServletResponse)respon);
//GO DIRECTLY TO THE POST METHOD
public void doPost(HttpServletRequest req,HttpServletResponse resp) throws ServletException,IOException
ServletInputStream sis=req.getInputStream();
if(sis.available()<2) //CHECK THAT THERE IS STREAM WHICH HAS AT LEAST 2 BYTES OF DATA!!
log("NO STREAM FROM APPLET");
else
//PERFORM ALL ACTIONS TO WRITE TO STREAM OF BYTES TO A LOCAL FILE
I have the servlet engine JServ 1.1.2 configured to run with Apache 1.3.19 on Windows 2000.
I compiled the Applet and the Servlet using JDK1.3 and JSDK2.0. I have JRE 1.3.1_02 installed on my Win2k machine.
Sorry for the long winded story here.
Awaiting a reply.
SNODX
(The search keywords combination getResponseCode multiple POST requests +Applet and many other related keyword combinations did not match any document in the Java forums. The search string "Multiple POST requests" "getResponseCode" and many other related search strings did not match any document in Google.I am continuing the search effort howeverinterresting the classloader solution. Well if that works, i would keep it like that so far.
But maybe this can help:
os.write(<some byte buffer>);
..and then
os.flush()//to make sure the outputstream is sent immediatly.
//i think getResponseCode() is not necsessary in that case
//but not certain, after all ...setUseCaches(false);
One thing you should do is remove the complete
service() {
...this.doPost();
the reason is that when a POST arrives at the servlet, the default service-method of the ancestor class (which is javax.servlet.Servlet) will automaticaly make a call to doPost() of the javax.servlet.http.HttpServlet subclass. You should not overide it I believe.
maybe... -try to establish an OutputStream only once in the Applet.
- receive the other end exactly once (as you did) in the doPost as an InputStream;
- eventually wrap both sides in respective Buffered(In)(Out)putStream(Reader)(Writer)
- start looping and .write() and .read() at both sides on the single and same in-and-outputStream();
(i.e avoid establishing the connection from the applet several times..., get one connection and keep it)
sorry if this story would be irrelevant,
Papyrus -
Creating a new OU and the login scripts don't work
Goodday,
We are running DSfW for almost a year and we never had to make a new OU but that time has come.
When I make a new OU (with iManager or AD tools) the outcome is the same: The login scripts I make for the new OU will not execute within iManager.
If I make a new (test)user of move an existing user (with or without a GW account) the login script is not executed.
If I place a login script directly on the user it works.
I've patched everything and is up-to-date.
What is different on exisiting OU's and new OU's is that it's missing two attributes:
ACL 2#entry#ou=...#loginScript
ACL 2#entry#ou=...#printJobConfiguration
Maybe this has nothing to do with it but the first one I was thinking maybe this is the problem.Originally Posted by preemeyer
Goodday,
We are running DSfW for almost a year and we never had to make a new OU but that time has come.
When I make a new OU (with iManager or AD tools) the outcome is the same: The login scripts I make for the new OU will not execute within iManager.
Can you please give the details of how you are specifying the login script. Is it using a GPO?
Originally Posted by preemeyer
If I make a new (test)user of move an existing user (with or without a GW account) the login script is not executed.
If I place a login script directly on the user it works.
Is it by specifying the script path in existing profile tab?
Originally Posted by preemeyer
I've patched everything and is up-to-date.
What is different on exisiting OU's and new OU's is that it's missing two attributes:
ACL 2#entry#ou=...#loginScript
ACL 2#entry#ou=...#printJobConfiguration
Maybe this has nothing to do with it but the first one I was thinking maybe this is the problem.
Can you check if the container is samified, and samify it if it is not.
domaincntrl --samify
May not work, but can be tried. -
Truncated POST requests in IE 10 - In Response to NTLM Authentication
In Internet Explorer 10, the browser is incorrectly truncating HTTP POST requests and submitting unsolicited NTLM negotiate headers with a HTTP Content-Length of Zero Bytes. This results in HTTP POST parameters failing to be submitted to the
server.
Assume the following web application with a context root of:
https://w3.someapplication.net/webapplication/
Secure cookies for this site are established at the context root of this application.
To reproduce this issue, a secure session is established at a protection space deeper than the root context of the web app:
https://w3.someapplication.net/webapplication/secure/login
After establishing a secure session with the web application, some client side artifacts are retrieved from a web proxy at a higher protection space:
https://w3.someapplication.net/webapplication/somejs.js
Subsequent HTTP POST requests to a deeper protection space will result in IE incorrectly attempting to pass an unsolicited NTLM negotiate header to the server side, and the HTTP POST request will be truncated with a Zero Content-Length header:
https://w3.someapplicaiton.net/webapplication/submit/form
The result is that the HTTP POST parameters submitted to the last URL will be lost.
This is reproducible against IE6 and IE10. It does not reproduce against IE8, or any non-Microsoft browser which all behave in a sane manner.
My Questions:
Why is IE behaving this way?
What can I do to make IE behave properly? Please don't suggest that I change the entire structure of my company's website to overcome this kind of silly bug in IE.
Is there a planned fix to correct this behavior back to the proper implementation observed in IE8?
Additional details about this problem are documented by an IE Internals blogger at the following url:
http://blogs.msdn.com/b/ieinternals/archive/2010/11/22/internet-explorer-post-bodies-are-zero-bytes-in-length-when-authentication-challenges-are-expected.aspx
MichaelYes, I have read that blog post in detail. All of the comments from Microsoft on this issue suggest making intrusive changes to the web application side to work around this "optimization". This is not an acceptable answer. This
is clearly a bug in IE. Evidence to support that this is a bug is that the behavior within IE's own browsers is not consistent; IE6 and IE10 will reproduce this issue, IE7 and IE8 will not.
I don't understand your suggestion; "ensure all paths are configured to require authentication". This is not a reasonable expectation for any normal web app. Our application does require authentication on all paths. However, when the first
authentication request goes through, a HTTP Session is established. Any subsequent request to that domain will not and should not be re-authenticated. IE making assumptions about the authentication requirements of a server side application is incorrect.
Further, even if i did re-challenge the browser for credentials on every path, regardless of whether a session is established or not, how would I handle the requirement to serve client side artifacts from a web proxy within that secure domain? Am I expected
to force my web proxy to require an NTLM header to serve up a CSS file? That is just silly.
You also suggested that my application might be incorrectly returning a 401. I can assure you, that is not the case. The flow is this:
Perform a signon to the application and retrieve some client side artifacts required by the splash page
https://w3.myapp.com/some/app/path?query=string
401 + www-negotiate response header
https://w3.myapp.com/some/app/path?query=string
browser provides a ntlm token, user is logged in, session is started
https://w3.myapp.com/some/file.js 200 response code, no challenge from the server side
Splash page is loaded; user submits a POST request
https://w3.myapp.com/some/app/path POST request fails because IE truncates the request and attaches an NTLM negotiate header with Zero Byte content length. This is an unsolicited negotiate header from IE.
Honestly, it really irritates me when people suggest we should change our entire application structure to accommodate IE bugs or "features" that are completely outside of the HTTP spec. I understand RFC4559 states that a browser MAY initiate a request
to a server which includes an unsolicited negotiate header, but it doesn't say anything about truncating the contents of that request.
No other browsers exhibit this behavior, and even the behavior within Microsoft's own product is not consistent. It is insanely frustrating as a web developer trying to deal with all of IE's little nuances.
Is there anyway this can be turned off via a registry entry? Is there any plan to fix this in a future release? -
Dear ALL
After successfully shifting the CRM from 2011 to 2013 i found a problem in Reporting section none of the report is working after some finding i conclude that MSCRM_FetchDataSource is not able to connect successfully
Through my report manager i tried to test the connection of MSCRM_FetchDataSource but i got the following error
System.Data.SqlClient.SqlException: Cannot open database "MSCRM_CONFIG" requested by the login. The login failed. Login failed for
user 'NT AUTHORITY\SYSTEM'.
I already add the NT Authority \ System as a db_owner under my database user of MSCRM_CONFIG
But still no success any one have any idea why it's happaning
Regards
RBI found a solution I hope my post will help other
I gave the db_owner to 'NT AUTHORITY\SYSTEM' and 'NT AUTHORITY\NETWORK' and assigned with both CRM and Config database
It resolved my issue
RB -
HTTP POST Request with XML file in
Hi @ all,
I would like to send an HTTP Request with an XML File in the body to an SAP System
I have the target URL and the a XML File.
Now the question is. Is it possible to use something like the HTTP_POST FuBa to send an url post request with an xml file?
If yes can anybody give me a hint?
I have a php script which exactly do this coding. But to integrate it all in one system it is necessary to transform it into ABAP and call it there.
// compose url and request and call send function
function test($productID, $categoryID) {
// create url
$PIhost = "XXX.wdf.sap.corp";
$PIport = "50080";
$PIurl = "/sap/xi/adapter_plain";
$PIurl .= "?sap-client=800";
$PIurl .= "&service=XXX";
$PIurl .= "&namespace=XXX";
$PIurl .= "&interface=Frontend_Interface";
$PIurl .= "&qos=EO";
$PIurl .= "&sap-user=XXX";
$PIurl .= "&sap-password=XXX";
// create xml
$request = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
$request .="<n1:FrontendInbound_MessageType xmlns:n1=\"http://crmpiebay.com\">\n";
$request .= "\t<FrontendInbound>\n";
$request .= "\t\t<ProductName/>\n";
$request .= "\t\t<ProductCategory>".$categoryID."</ProductCategory>\n";
$request .= "\t\t<ProductID>".$productID."</ProductID>\n";
$request .= "\t\t<MessageID/>\n";
$request .= "\t</FrontendInbound>\n";
$request .= "</n1:FrontendInbound_MessageType>";
// send http request
postToHost($PIhost, $PIport, $PIurl, $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"]."/".$_SERVER["PHP_SELF"], $request);
// send post request to PI server
function postToHost($host, $port, $path, $referer, $data_to_send) {
$fp = fsockopen($host, $port);
if($fp) {
$res="";
fputs($fp, "POST $path HTTP/1.1\r\n");
fputs($fp, "Host: $host\r\n");
fputs($fp, "Referer: $referer\r\n");
fputs($fp, "Content-type: text/plain\r\n");
fputs($fp, "Content-length: ". strlen($data_to_send) ."\r\n");
fputs($fp, "Connection: close\r\n\r\n");
fputs($fp, $data_to_send);
while(!feof($fp)) {
$res .= fgets($fp, 128);
fclose($fp);
return $res;
Would be great if anybody could give me a hint how to solve such a HTTP Post request with XML body data.
Thanks in advance.
Chris
Edited by: Christian Kuehne on Feb 26, 2009 4:32 PMhi friend could you please share your solution regarding this query if u got it already?
-
MEMBER OF command in login script
Hello,
Just wondering if any one else has had trouble getting the MEMBER OF command to work in their login script? I have tried using group names as well as the full context but I can't get it to work and perform the desired actions.
Thanks.On Wed, 12 Jun 2013 14:26:02 +0000, captainjd02006 wrote:
> Just wondering if any one else has had trouble getting the MEMBER OF
> command to work in their login script?
It's worked for me here for 15+ years. Maybe you're doing it wrong? Show
us a sample of what you're trying to do.
David Gersic dgersic_@_niu.edu
Knowledge Partner http://forums.netiq.com
Please post questions in the forums. No support provided via email. -
SIMPLE login script install of zfd4 agent?
Is there is simpler way of installing the zfd4 agent via a login script when
I'm not using an intermediate tier or use the application explorer. The
login script examples I've found onlnie (and information in the Novell docs
and Novel Press books) seem complex and frought with pitfalls...
Thanks,
KB> I'm reviewing this TID; I may be able to do this on my own. However, if
> anyone has an example, working "simple" login script they could post as
an
> example, it would be REALLY appreciated....
>
> Thanks!
> KB
> "KB" <[email protected]> wrote in message
> news:mHgfg.738$[email protected]..
> > Forgot to mention - I want to run this in silent mode, and need to
handle
> > the issue where someone already has the agent installed...
> >
> > Thanks,
> > KB
> >
> > "KB" <[email protected]> wrote in message
> > news:Dfgfg.703$[email protected]..
> >> Is there is simpler way of installing the zfd4 agent via a login
script
> >> when I'm not using an intermediate tier or use the application
explorer.
> >> The login script examples I've found onlnie (and information in the
> >> Novell docs and Novel Press books) seem complex and frought with
> >> pitfalls...
> >>
> >> Thanks,
> >> KB
> >>
> >
> >
>
>
Hi,
your Login Script must be seen like this:
#z:exist c:\programme\novell\zenworks\nalwin32.exe
if "%ERRORLEVEL"="0" THEN GOTO NOTHING
#z:\zfdagent\agent.bat
NOTHING:
END
the agent.bat is a batch File to install the agent in silent mode
it looks like that:
msiexec /i z:\zfdagent\zfdagent.msi /qn ADDLOCAL=ALL EDITABLE_MT_ADDRESS=1
STARTUP_APPWINDOW=1 STARTUP_APPEXPLORER=0 REBOOT=ReallySuppress /l*v %
WINDIR%\zfdagent.log
the z:\zfdagent is a subdirectory in the sys:\system\Public where
zfdagent.msi file exists.
hier is a link to download exist.exe
Download: http://www.novell.com/coolsolutions/...oads/exist.zip
Best regards
Issam -
Has anyone had success using login scripts from OD? When I try to add a script to the login prefs, i get an error that the script is not executable.
Alternately, could anyone suggest an effective way to mount volumes based on user group membership? I've tried adding scripts, automator created apps and workflows to the login items without success.
thanks.Hi
Good question. I don’t really know. What I can say is I once attended a site where two of Apple Euro’s technical consultants implemented both methods. Neither mentioned either as being ‘best practice’. Both methods worked by the way. My gut feeling is the method not involving a login script would probably be what Apple would steer you towards. Although in my opinion whatever method works for you that gives you what you want would be ‘best practice’.
Try cross posting this in the Terminal Forum. There are some guys there who are pretty handy when it comes to AppleScript.
Hope this helps – Tony -
Dear folks
I have done NTLM authentication successfully and got the logged in username, but my POST request quits working after NTLM authentication.
I have logged the HTTP headers using RequestDumperValve, it shows that even though the user is authenticated the browser sends authorization header on every POST request and its content-length is zero.
Im not able to understand the problem.
This problem is already discussed in many groups but all replied JCIFS, but i don't want to use it.
My configuration Apache 1.3,Tomcat 4.0,Mod_JK
Why the POST Request is not working?
Any help will be appreciated.
Regards
GaneshYep, I am french so sorry for my english. I have maybe a solution, i have got the same problem with POST request after NTLM auth, they don't work with my ajax application.
I have search search and search, and i have write that :
You must place that in first place in your html file, before any tag ( so before <html> tag ).
I hope that this can help anyone...
<%
boolean isUserNameRecuperer = false;
boolean isAutorisationSend = (request.getHeader("Authorization") != null);
if (!isAutorisationSend)
response.setHeader("WWW-Authenticate", "NTLM");
response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
return;
else
String authorisationCode = request.getHeader("Authorization");
boolean isNTLMAutorisation = authorisationCode.substring(0, 4).equals("NTLM");
if (isNTLMAutorisation)
authorisationCode = authorisationCode.substring(5);
BASE64Decoder base_64decoder = new BASE64Decoder();
byte[] authorisationCode64 = base_64decoder.decodeBuffer(authorisationCode);
System.out.println("NTLM Flag " +authorisationCode64[8]);
if( authorisationCode64[8] == 1 )
if (authorisationCode64[13] == 178)
System.out.println("NTLM Flag Error");
//stop
String retAuth = "NTLMSSP"+Character.toString((char)0)+Character.toString((char)2)+Character.toString((char)0)+Character.toString((char)0)+Character.toString((char)0)+Character.toString((char)0)+Character.toString((char)0)+Character.toString((char)0);
retAuth += Character.toString((char)0)+Character.toString((char)40)+Character.toString((char)0)+Character.toString((char)0)+Character.toString((char)0)+Character.toString((char)001)+Character.toString((char)130)+Character.toString((char)000)+Character.toString((char)000);
retAuth += Character.toString((char)0)+Character.toString((char)2)+Character.toString((char)2)+Character.toString((char)2)+Character.toString((char)0)+Character.toString((char)000)+Character.toString((char)000)+Character.toString((char)000)+Character.toString((char)000);
retAuth += Character.toString((char)0)+Character.toString((char)0)+Character.toString((char)0)+Character.toString((char)0)+Character.toString((char)0)+Character.toString((char)000)+Character.toString((char)000);
BASE64Encoder base_64encoder = new BASE64Encoder();
String retAuth64 = base_64encoder.encode(retAuth.getBytes());
retAuth64.trim();
response.setHeader("WWW-Authenticate", "NTLM "+ retAuth64);
response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
return;
else if (authorisationCode64[8] == 3)
//le domaine
int lenght = (authorisationCode64[31]*256 + authorisationCode64[30]); // longueur du domain
int offset= (authorisationCode64[33]*256 + authorisationCode64[32]); // position du domain.
String codeATraiter = "";
for (int i=0; i < authorisationCode64.length; i++)
codeATraiter += (char) authorisationCode64;
String domain = codeATraiter.substring(offset, offset+lenght); // decoupage du du domain.
domain.replace("\0", "");
//le login
lenght = (authorisationCode64[39]*256 + authorisationCode64[38]); // longueur du domain
offset = (authorisationCode64[41]*256 + authorisationCode64[40]); // position du domain.
String username = codeATraiter.substring(offset, offset+lenght); // decoupage du du domain.
username = username.replaceAll("\0", "");
System.out.println(username);
isUserNameRecuperer = true;
response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
%>
It's normal that the last status of my page is response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
in an other case that block any POST request.
Message was edited by:
BoBlepepeur -
Part of login script not processing
Running OES 11 with Windows 7 clients.
I have a couple of drives that are not OES based. One is a NAS box
and the other is a virtual appliance. I can manually execute the NET
USE command on any Windows 7 PC in my office and map a drive letter to
either unit. The NAS box works fine in my login script. Everyone
company wide needs access to it, so the login script includes these
two lines:
@NET USE U: /DELETE
@NET USE U: \\nas_box\path /PERSISTENT:NO
Now I need to add the appliance. The net use command works fine
manually for the appliance. Only a few specific people need access to
it, so I created a group in eDirectory and added these lines to my
login script
IF MEMBER OF "appliance_group.my_org" THEN BEGIN
@NET USE P: /DELETE
@NET USE P: \\appliance\path /PERSISTENT:NO /USER:username password
END
The drive is not showing up. I'm stumped. I can't find any typos,
the group exists and has the right members, and I can manually run the
command and it works. So why wouldn't it run/map during the login
script? How can I troubleshoot this?
Thanks!
KenOn 10/02/2014 15:58, KeN Etter wrote:
> Running OES 11 with Windows 7 clients.
>
> I have a couple of drives that are not OES based. One is a NAS box
> and the other is a virtual appliance. I can manually execute the NET
> USE command on any Windows 7 PC in my office and map a drive letter to
> either unit. The NAS box works fine in my login script. Everyone
> company wide needs access to it, so the login script includes these
> two lines:
>
> @NET USE U: /DELETE
> @NET USE U: \\nas_box\path /PERSISTENT:NO
>
> Now I need to add the appliance. The net use command works fine
> manually for the appliance. Only a few specific people need access to
> it, so I created a group in eDirectory and added these lines to my
> login script
>
> IF MEMBER OF "appliance_group.my_org" THEN BEGIN
> @NET USE P: /DELETE
> @NET USE P: \\appliance\path /PERSISTENT:NO /USER:username password
> END
>
> The drive is not showing up. I'm stumped. I can't find any typos,
> the group exists and has the right members, and I can manually run the
> command and it works. So why wouldn't it run/map during the login
> script? How can I troubleshoot this?
TID 7014158[1] perhaps?
HTH.
[1] http://www.novell.com/support/kb/doc.php?id=7014158
Simon
Novell Knowledge Partner
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below. Thanks. -
Is there a good way that one can run a login script as root these days? In doing some research, I learned about login hooks, which assist with that. Though with further research, I learned that newer OSes don't support that (or, rather, are depricated). Is there maybe some sort of app you can run which will give you root access at a standard user login? I am needing to work with the current user's home directories- as in, rename stuff that a standard user can't seem to do.
Though on a related note, I noticed that OS X creates extended attributes in the user's folders which says that "everyone" can't delete them. Renaming them wouldn't count as the delete attribute since I'd use the mv command on it, would it? I haven't tried yet but I'm assuming that isn't my answer, anyway.
Thanks!is this somthing that needs to be done each time you or the other user logs in or does it just need to be done once?
If it is ongoing then yes you might have to do this with some sort of login script. But if it is a one time thing (make the alias once and that's it), then you can use the sudo command.
Roughly you would log in as yourself, open the terminal app and then use the sudo command to change the other users folder.
If it is a one time thing post back and explain EXACTLY what it is you need to do and we'll try to come up with the steps to do it.
If it is an ongoing thing then I'm not sure what the best path is to take.
regards
Maybe you are looking for
-
Why am I having money taken from my account and I do not know what it is for?
Why do I keep having money deducted from my account?? I do not download apps tha u have to pay for I only download them that are free? I do not know we're the money is going what can I do about it
-
I downloaded a HD movie for rental and every time i go to play it i get a error saying we could not complete your Itunes store request. a Unknown error occurred (-42110)
-
Workspace of BPM Enterprise 10.3.1 for Weblogic
I just install BPM Enterprise 10.3.1 for weblogic. I configure it using default setting. In the BPM admin center, it has 5 options: Start Stop Start process administrator configuration exit Where is the workspace?
-
De-authorization of all computers
I am having issues with de-authorization of my 5 computers. Every time when I tried to do that, it gives me an error stating that I have to wait until Dec. 20, 2010 in order to do that. Does anyone know how I can do this today instead of waiting unti
-
AMD OverDrive Center vs. MSI ControlCenter
Which one is better to use? I don't Overclock yet, but if and when I do, which is better to use or do i use both? Do you have a better suggestion & can up point me in the right direction if you do? Either way, I would appreciate your help & knowledge