HTTP Post - UserID/password

Our application performs an HTTP Post using Inet object's
PostURL function.
It works fine while our web-server is set as "public", but
when we set security on the web-server to require a
challange/response logon the HTTP Post fails.
How do we pass credentials (UserID and password) information
in a PostURL call?
Thanks in advance.
0
Flavio
6/22/2004 7:21:08 PM
sybase.powerbuilder.general 62418 articles. 18 followers. Follow

5 Replies
612 Views

Similar Articles

[PageSpeed] 10

Hi there,

Straight from the help file

This example shows the use of a header with the correct
content-type for a form:

Blob lblb_args

 String ls_headers

 String ls_url

 String ls_args

 long ll_length

 integer li_rc



 li_rc = GetContextService( "Internet", iinet_base )

 IF li_rc = 1 THEN

    ir = CREATE n_ir

    ls_url = "http://localhost/Site/testurl.stm?"

    ls_args = "user=MyName&pwd=MyPasswd"

    lblb_args = Blob( ls_args )

    ll_length = Len( lblb_args )

    ls_header = "Content-Type: " + &

       "application/x-www-form-urlencoded~n" + &

       "Content-Length: " + String( ll_length ) + "~n~n"

    li_rc = iinet_base.PostURL( ls_url, lblb_args, &

       ls_header, ir )



HTH
John Vanleeuwe

 END IF> Our application performs an HTTP Post using Inet
object's
> PostURL function.
> It works fine while our web-server is set as "public", but
> when we set security on the web-server to require a
> challange/response logon the HTTP Post fails.
> How do we pass credentials (UserID and password)
> information in a PostURL call?
> Thanks in advance.
0
John
6/23/2004 6:29:23 AM
Hi John,

What you got from the help file is how arguments are passed
to the web page. But my problem is before we hit the webpage
we have to logon to the web-server.
Thanks anyway.

I thought this newsgroup was monitored by Sybase people who
could provide us help, but is does not look like.

Flavio

> Hi there,
>
> Straight from the help file
>
> This example shows the use of a header with the correct
> content-type for a form:
>
> Blob lblb_args
>
>  String ls_headers
>
>  String ls_url
>
>  String ls_args
>
>  long ll_length
>
>  integer li_rc
>
>
>
>  li_rc = GetContextService( "Internet", iinet_base )
>
>  IF li_rc = 1 THEN
>
>     ir = CREATE n_ir
>
>     ls_url = "http://localhost/Site/testurl.stm?"
>
>     ls_args = "user=MyName&pwd=MyPasswd"
>
>     lblb_args = Blob( ls_args )
>
>     ll_length = Len( lblb_args )
>
>     ls_header = "Content-Type: " + &
>
>        "application/x-www-form-urlencoded~n" + &
>
>        "Content-Length: " + String( ll_length ) + "~n~n"
>
>     li_rc = iinet_base.PostURL( ls_url, lblb_args, &
>
>        ls_header, ir )
>
>
>
> HTH
> John Vanleeuwe
>
>  END IF> Our application performs an HTTP Post using Inet
> object's
> > PostURL function.
> > It works fine while our web-server is set as "public",
> > but when we set security on the web-server to require a
> > challange/response logon the HTTP Post fails.
> > How do we pass credentials (UserID and password)
> > information in a PostURL call?
> > Thanks in advance.
0
Flavio
6/24/2004 8:34:51 PM
John,

Be patient. There aree people her who can help you. Sometimes people don't
understand you problemn when they give a response. They are just trying to help.
There extremely compitent people here who may be ablel to answer your questions.
For the future, people with [TeamSybase] afterthere name are the official gurus
here. 

 On 24 Jun 2004 13:34:51 -0700,
 in sybase.public.powerbuilder.general
 <Flavio> wrote: 
>Hi John,
>
>What you got from the help file is how arguments are passed
>to the web page. But my problem is before we hit the webpage
>we have to logon to the web-server.
>Thanks anyway.
>
>I thought this newsgroup was monitored by Sybase people who
>could provide us help, but is does not look like.
>
>Flavio
>
>> Hi there,
>>
>> Straight from the help file
>>
>> This example shows the use of a header with the correct
>> content-type for a form:
>>
>> Blob lblb_args
>>
>>  String ls_headers
>>
>>  String ls_url
>>
>>  String ls_args
>>
>>  long ll_length
>>
>>  integer li_rc
>>
>>
>>
>>  li_rc = GetContextService( "Internet", iinet_base )
>>
>>  IF li_rc = 1 THEN
>>
>>     ir = CREATE n_ir
>>
>>     ls_url = "http://localhost/Site/testurl.stm?"
>>
>>     ls_args = "user=MyName&pwd=MyPasswd"
>>
>>     lblb_args = Blob( ls_args )
>>
>>     ll_length = Len( lblb_args )
>>
>>     ls_header = "Content-Type: " + &
>>
>>        "application/x-www-form-urlencoded~n" + &
>>
>>        "Content-Length: " + String( ll_length ) + "~n~n"
>>
>>     li_rc = iinet_base.PostURL( ls_url, lblb_args, &
>>
>>        ls_header, ir )
>>
>>
>>
>> HTH
>> John Vanleeuwe
>>
>>  END IF> Our application performs an HTTP Post using Inet
>> object's
>> > PostURL function.
>> > It works fine while our web-server is set as "public",
>> > but when we set security on the web-server to require a
>> > challange/response logon the HTTP Post fails.
>> > How do we pass credentials (UserID and password)
>> > information in a PostURL call?
>> > Thanks in advance.

Jim Smith
jrsmithATduqlightDOTcom
0
Jim
6/24/2004 8:52:47 PM
John et al,

HTTP authentication is a part of the HTTP header. If you trace an HTTP 
request using a tool like TCPTrace (free from 
http://www.pocketsoap.com), you will see something like the following:

GET / HTTP/1.1
Accept: */*
Accept-Language: en-us
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 
1.1.4322)
Host: z4:8080
Connection: Keep-Alive
Authorization: Basic UGghSVN4YmFdDTpthTXBsZxYRyZWU=

The last line is the one that is of interest to you -- basic 
authentication takes the username and password that you provide, 
concatenates them into a single string, then base64 encodes them.

Next -- how does one base64 encode a string? Well, if you are using 
PowerBuilder 9, you can use the base64 encoder in the following PBNI 
extension -- 
http://powerbuilder.codexchange.sybase.com/files/documents/67/1319/PBNIPowerPack.zip

If you are using an earlier version of PB, here is a free COM components 
that provides this functionality -- 
http://www.sevillaonline.com/ActiveX/Base64.htm

Last but not least, please note that TeamSybase members are not Sybase 
employees, but product users who volunteer their time to help folks in 
these forums. We have day jobs just like you, and may not be able to 
respond within the hour to every post. If you need assistance and cannot 
wait for an answer in the forum, you should consider contacting 
technical support at 1-800-SYBASE-8

Best,
--
Roy

Jim Smith wrote:
> John,
> 
> Be patient. There aree people her who can help you. Sometimes people don't
> understand you problemn when they give a response. They are just trying to help.
> There extremely compitent people here who may be ablel to answer your questions.
> For the future, people with [TeamSybase] afterthere name are the official gurus
> here. 
> 
>  On 24 Jun 2004 13:34:51 -0700,
>  in sybase.public.powerbuilder.general
>  <Flavio> wrote: 
> 
>>Hi John,
>>
>>What you got from the help file is how arguments are passed
>>to the web page. But my problem is before we hit the webpage
>>we have to logon to the web-server.
>>Thanks anyway.
>>
>>I thought this newsgroup was monitored by Sybase people who
>>could provide us help, but is does not look like.
>>
>>Flavio
>>
>>
>>>Hi there,
>>>
>>>Straight from the help file
>>>
>>>This example shows the use of a header with the correct
>>>content-type for a form:
>>>
>>>Blob lblb_args
>>>
>>> String ls_headers
>>>
>>> String ls_url
>>>
>>> String ls_args
>>>
>>> long ll_length
>>>
>>> integer li_rc
>>>
>>>
>>>
>>> li_rc = GetContextService( "Internet", iinet_base )
>>>
>>> IF li_rc = 1 THEN
>>>
>>>    ir = CREATE n_ir
>>>
>>>    ls_url = "http://localhost/Site/testurl.stm?"
>>>
>>>    ls_args = "user=MyName&pwd=MyPasswd"
>>>
>>>    lblb_args = Blob( ls_args )
>>>
>>>    ll_length = Len( lblb_args )
>>>
>>>    ls_header = "Content-Type: " + &
>>>
>>>       "application/x-www-form-urlencoded~n" + &
>>>
>>>       "Content-Length: " + String( ll_length ) + "~n~n"
>>>
>>>    li_rc = iinet_base.PostURL( ls_url, lblb_args, &
>>>
>>>       ls_header, ir )
>>>
>>>
>>>
>>>HTH
>>>John Vanleeuwe
>>>
>>> END IF> Our application performs an HTTP Post using Inet
>>>object's
>>>
>>>>PostURL function.
>>>>It works fine while our web-server is set as "public",
>>>>but when we set security on the web-server to require a
>>>>challange/response logon the HTTP Post fails.
>>>>How do we pass credentials (UserID and password)
>>>>information in a PostURL call?
>>>>Thanks in advance.
> 
> 
> Jim Smith
> jrsmithATduqlightDOTcom
0
Roy
6/24/2004 10:28:23 PM
To add to what Roy said, this newsgroup is provided by Sybase as a
peer-to-peer forum. It is not intended as a means of contacting
Sybase. If you want to contact Sybase tech support, the information
should be available, specific to your region, in your PowerBuilder
package or on the Sybase web site.

Good luck,

Terry [TeamSybase] and Sequel the techno-kitten

On 24 Jun 2004 13:34:51 -0700, Flavio wrote:

>Hi John,
>
>What you got from the help file is how arguments are passed
>to the web page. But my problem is before we hit the webpage
>we have to logon to the web-server.
>Thanks anyway.
>
>I thought this newsgroup was monitored by Sybase people who
>could provide us help, but is does not look like.
>
>Flavio
>
>> Hi there,
>>
>> Straight from the help file
>>
>> This example shows the use of a header with the correct
>> content-type for a form:
>>
>> Blob lblb_args
>>
>>  String ls_headers
>>
>>  String ls_url
>>
>>  String ls_args
>>
>>  long ll_length
>>
>>  integer li_rc
>>
>>
>>
>>  li_rc = GetContextService( "Internet", iinet_base )
>>
>>  IF li_rc = 1 THEN
>>
>>     ir = CREATE n_ir
>>
>>     ls_url = "http://localhost/Site/testurl.stm?"
>>
>>     ls_args = "user=MyName&pwd=MyPasswd"
>>
>>     lblb_args = Blob( ls_args )
>>
>>     ll_length = Len( lblb_args )
>>
>>     ls_header = "Content-Type: " + &
>>
>>        "application/x-www-form-urlencoded~n" + &
>>
>>        "Content-Length: " + String( ll_length ) + "~n~n"
>>
>>     li_rc = iinet_base.PostURL( ls_url, lblb_args, &
>>
>>        ls_header, ir )
>>
>>
>>
>> HTH
>> John Vanleeuwe
>>
>>  END IF> Our application performs an HTTP Post using Inet
>> object's
>> > PostURL function.
>> > It works fine while our web-server is set as "public",
>> > but when we set security on the web-server to require a
>> > challange/response logon the HTTP Post fails.
>> > How do we pass credentials (UserID and password)
>> > information in a PostURL call?
>> > Thanks in advance.


Sequel's Sandbox: http://www.techno-kitten.com
Home of PBL Peeper, a free PowerBuilder Developer's Toolkit. 
Version 2.2.06 now available at the Sandbox
See the PB Troubleshooting Guide at the Sandbox
^ ^
o o
=*=
0
Terry
6/25/2004 3:07:54 AM
Reply:

Similar Artilces:

Posting using HTTP GET instead of HTTP POST from Textbox control
Hi I feel almost silly asking this question, but I want to use HTTP GET instead of the default HTTP POST that asp.net uses when a user enters some text in my textbox and clicks on the associated button. How do I do that? Regards, Egil. You can explicitly specify "get" for method attribute of your form. Like this: <form id="form1" runat="server" method="get"> I am not sure why you would want to do this. This causes _VIEWSTATE to show up in your URL and as a query string. And there is a length limitation on query string. The HTML specifications technically define the...

Error to post powerbuilder \General forum
Hai all I cannot post in Powerbuilder/General forum. An error is coming When I am trying to post. Pls help with thnaks Polachan ---== Posted via the PFCGuide Web Newsreader ==--- http://www.pfcguide.com/_newsgroups/group_list.asp And the error is? On 6 Oct 2008 01:34:33 -0700, "polachan" <polachan> wrote: >Hai all > >I cannot post in Powerbuilder/General forum. An error is coming When I am trying >to post. > >Pls help > >with thnaks >Polachan >---== Posted via the PFCGuide Web Newsreader ==--- >http://www.pfcgui...

Password, Password, Password
How can I login once per session and not have to reenter my root password every time I open YaST, etc. I believe in good security so I use strong passwords and I am also new to Linux which requires a lot of toying around so I have to enter my password over and over every session. -- OpenSourceRules ------------------------------------------------------------------------ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 You could setup sudoers so you could call 'sudo /path/to/application' and have that NOT prompt you for a password. 'man sudoers' for more...

HTTP::Request::Common questions re: POST and passwords
HTTP::Request::Common seems like a perfect module for this task I have. At our Web site, the online editors manually update forms every night with information I can easily pull in with perl. I am now trying to figure out how to get HTTP::Request::Common working and have some questions. Here's the code I have written. Questions below: use HTTP::Request::Common; $ua = LWP::UserAgent->new; $ua->request(POST $urlToSendTo, Content_Type => 'form-data', Content => [ sectionID => $sectionID, headerLabel1 => $headerLabel1, ...

superreview requested: [Bug 316995] When migrating from Internet Explorer http auth passwords are not migrated : [Attachment 229907] Add support for importing HTTP auth passwords from IE
Michael Wu <michael.wu@mozilla.com> has asked Mike Connor <mconnor@mozilla.com> for superreview: Bug 316995: When migrating from Internet Explorer http auth passwords are not migrated https://bugzilla.mozilla.org/show_bug.cgi?id=316995 Attachment 229907: Add support for importing HTTP auth passwords from IE https://bugzilla.mozilla.org/attachment.cgi?id=229907&action=edit ------- Additional Comments from Michael Wu <michael.wu@mozilla.com> Ok, so I was wrong about http auth info not being stored in PStore. This patch adds support for importing HTTP auth data ...

superreview cancelled: [Bug 316995] When migrating from Internet Explorer http auth passwords are not migrated : [Attachment 229907] Add support for importing HTTP auth passwords from IE
Mike Connor <mconnor@mozilla.com> has cancelled Michael Wu <michael.wu@mozilla.com>'s request for superreview: Bug 316995: When migrating from Internet Explorer http auth passwords are not migrated https://bugzilla.mozilla.org/show_bug.cgi?id=316995 Attachment 229907: Add support for importing HTTP auth passwords from IE https://bugzilla.mozilla.org/attachment.cgi?id=229907&action=edit ------- Additional Comments from Mike Connor <mconnor@mozilla.com> Good work, thanks! ...

HTTP Post & HTTP Get
Hi, We have a web service written in .net 1.0 which is using the post & get protocols. When we installed .net 1.1 on the server hosting the app the web service stopped working. We found that this was because in the 1.1 machine config the post and get protocols are disabled so we enabled and alls well again. What i don't understand though is why its happening! The web service is written in .net 1.0 so surely it should be looking at the 1.0 machine.config which does have the protocols enabled rather than the 1.1 config that does not have the protocols enabled. Event...

How do you post XML via http post
I have the xml code below and I need to post it via HTTP POST  to this site http://dmp.dynmark.com/XmlHttp/MessageMTSend.aspx                     "<?xml version='1.0' encoding='utf-8'?> "                     "<Dmp xmlns='http://dmp.dynmark.com/XmlHttp/MessageMTSend.xsd' version='1.0'>"                &n...

Eksemple on http post instead of http get.
Does anyone have an example on a http post instead of the http-get in the following example... http://poe.perl.org/?POE_Cookbook/Web_Client Example 2: Multiple requests in a single session. regards Michael. Sure! I've done this before. I'll make one and put it at the bottom as example 3. David ---------- Original Message ----------- From: "Michael" <michael@webactor.dk> To: poe@perl.org Sent: Wed, 4 Feb 2004 17:23:58 +0100 Subject: Eksemple on http post instead of http get. > Does anyone have an example on a http post instead >...

Consume web service with HTTP-GET or HTTP-POST
 I would like to consume a web service with HTTP-GET or HTTP-POST. I tried to google it but couldn't find exactly what I need. I think we need to create htttpwebrequest object, and pass parameters like request.type GET or POST. But I couldn't find how to pass username, password and input parameters at the same time specify the web method to use. Can some one explain regarding this.  Thank you Hi, http://msdn.microsoft.com/en-us/library/45fez2a8(VS.80).aspx http://www.codeproject.com/KB/webservices/aspwebsvr.aspx  BabaIf this post was useful to you, please Don'...

AD password change not synching to Notes HTTP Password
I am attempting to synch AD password changes through the vault to Lotus Notes HTTP Password. When I reset the password on an AD account, the AD trace log shows a successful password change and the password is updated in the vault. The Notes trace log also shows HTTPPassword was set successfully for my user. So there are no errors in either trace log, just succesful events. However, the HTTP password does not change on the user record in Lotus Notes. The only way I can change the password is if I modify the user record and manually change it. I am using a Notes ID with full ad...

Http Post
I am working on an e-commerce application, which requires us to send an XML (based) message, via HTTP post to our vendor (supplier). For those who are familiar with it, it is CXML (www.cxml.org). There is plenty of information on specs regarding the formatting of the message, header fields, data, etc. What is lacking is how to produce the message in Asp.Net. How do go through the exercise of creating the XML and sending an HTTP post myself? This task is normally handled by the runtime, but I have to generate it myself since it is a different protocol built ON TOP of Http? Than...

Http:// and Http:// ?!
Hi, How can I change https:// to http:// or vice versa in the VB.NEt or C#?Thanks, If your simply trying to alter the string you could do something like this:strURL = "https://..."strURL.Replace("https", "http")End result here should be "http://..."...

HTTP with GET method OK but HTTP with POST method not working
Hi .NET Proz, I had create a vb.aspx form to process some task when using http get method or post method:- Now my problem is when i using HTTP with GET method everything works fine but when using HTTP with POST method its not working. Any ideas besides coding error? Thanks! Hi, Could you post your codes to elaborate your question? Or you can check some refferences about get and post: http://www.cs.tut.fi/~jkorpela/forms/methods.htmlVince XuMicrosoft Online Community Support Please remember to mark the replies as answers if they help and unmark them if they provide no help....

My posts not being posted?
Sorry, had to do a test - I replied to a thread twice but neither of my posts have appeared...... On 12-08-08 1:47 PM, Gordon wrote: > Sorry, had to do a test - I replied to a thread twice but neither of my > posts have appeared...... This group is moderated, so that all posts go through the mailing list and SpamAssassin. SpamAssassin gave your posts a higher than normal spam score, so it held them for moderator approval. -- Chris Ilias <http://ilias.ca> Mailing list/Newsgroup moderator On 09/08/12 04:31, Chris Ilias wrote: > This group is moderated, so t...

Web resources about - HTTP Post - UserID/password - sybase.powerbuilder.general

One-time password - Wikipedia, the free encyclopedia
A one-time password (OTP) is a password that is valid for only one login session or transaction. OTPs avoid a number of shortcomings that are ...

Oregon To Consider Bill Blocking Employers From Demanding Applicants’ Facebook Passwords
The Oregon House of Representatives will hear a bill Friday that would prevent employers from demanding that job applicants reveal their passwords ...

Keeping Passwords Secure
The Facebook Security team has always kept a close eye on data breach announcements from other organizations. Theft of personal data like email ...

New Facebook Security Features: One-Time Passwords, Security Info
Facebook has launched two new security features to help users stay in control of their accounts. Users can now receive a one-time password from ...

Generate passwords you can actually remember with WordCreator
It’s important to use strong passwords to secure web accounts, and there are plenty of free generators around to help. But most produce random ...

Google is testing a bold new idea for killing passwords
Google wants to see passwords die just as much as the rest of us do, which is why it's spent years coming up with wild experiments for new protocols ...

Google tests password-free logins
Google has confirmed it is testing a way for users to log in to its services using just their smartphone and no password.

2015 trends: The evolution of password security
Why you should get on board with fingerprint sensors and two-factor authentication.

How to evaluate password managers
All password managers have as many as four separate products for storing passwords: a desktop and mobile app, a browser extension, or a pure ...

Ditch the sticky notes to keep your passwords handy and secure
In this age of cyber theft, keeping your passwords on a pad of paper or (even worse) an online document just won’t cut it, no matter how indecipherable ...

Resources last updated: 1/4/2016 5:49:21 PM