473,387 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

@ character in http login

I am trying to use the basic http://user:pa******@example.com
form for authentication inside a script.

My only problem is my username contains the @ character (its an
email address). As result, the url seems to be parsing
incorrectly.

Has anyone found a way around this problem?

Cheers
Simon

--
Stupendous Tales
www.stupendoustales.com
Speculative Fiction, Pulp Dreams
Apr 23 '06 #1
13 1837
si****@nospam.com wrote in <e2**********@reader1.panix.com> on Sat April 22
2006 22:53:
I am trying to use the basic http://user:pa******@example.com
form for authentication inside a script.

My only problem is my username contains the @ character (its an
email address). As result, the url seems to be parsing
incorrectly.

Has anyone found a way around this problem?

Cheers
Simon


Well, the way it usually works is:

http://user:pass@server/

You may be able to try this:

http://user%40sample.com:pass@server

And see if it works. 0x40 is the hex character code for '@', and URL
encoding works by using % and then the hex char reference (i.e., %20 for a
space, %40 for '@', and so forth).

If that doesn't work, then I don't know what else you could do to make it
work, at least, when authenticating using basic auth like that.

- Mike

Apr 23 '06 #2
>I am trying to use the basic http://user:pa******@example.com
form for authentication inside a script.

My only problem is my username contains the @ character (its an
email address). As result, the url seems to be parsing
incorrectly.

Has anyone found a way around this problem?


You may be able to use something like
http://username%40hotmail.com:pa******@example.com

where @ is converted to %40 . The same approach may apply if the
password contains odd characters like @, colon, space, %, etc.

Gordon L. Burditt
Apr 23 '06 #3
Gordon Burditt wrote in <12*************@corp.supernews.com> on Sat April 22
2006 23:18:
I am trying to use the basic http://user:pa******@example.com
form for authentication inside a script.

My only problem is my username contains the @ character (its an
email address). As result, the url seems to be parsing
incorrectly.

Has anyone found a way around this problem?


You may be able to use something like
http://username%40hotmail.com:pa******@example.com

where @ is converted to %40 . The same approach may apply if the
password contains odd characters like @, colon, space, %, etc.

Gordon L. Burditt


FYI, you may want to read to ensure that the question hasn't been answered
the same way you're about to answer it. It is bad form; the question was
answered twelve minutes prior to you posting the same thing.

Regards,
Mike

Apr 23 '06 #4
>FYI, you may want to read to ensure that the question hasn't been answered
the same way you're about to answer it. It is bad form; the question was
answered twelve minutes prior to you posting the same thing.


I did. Remember that USENET transmission is not instantaneous.
Also, article composition takes time. It used to be that a feed
that was getting articles 3 days old from the far side of the net
(consisting largely of UUCP feeds) was operating unusually better
than normal.

Even now, I doubt that even all well-connected servers get a posted
article within 2 hours of when it is posted on one of them.

Gordon L. Burditt
Apr 23 '06 #5
Michael B. Trausch <mi*********************@comcast.net> wrote:
si****@nospam.com wrote in <e2**********@reader1.panix.com> on Sat April 22
2006 22:53:
I am trying to use the basic http://user:pa******@example.com
form for authentication inside a script.

My only problem is my username contains the @ character (its an
email address). As result, the url seems to be parsing
incorrectly.

Has anyone found a way around this problem?

Cheers
Simon


Well, the way it usually works is:

http://user:pass@server/

You may be able to try this:

http://user%40sample.com:pass@server

Thank you for the pointer, it pointed me to the right solution.

It looks like @ is the escape character that works for @,
rather than %40. On using the parse_url() function on the url,
the correct email username was returned for the user element in
the resulting array.

Cheers
Simon

--
Stupendous Tales
www.stupendoustales.com
Speculative Fiction, Pulp Dreams
Apr 23 '06 #6
si****@nospam.com wrote in <e2**********@reader1.panix.com> on Sun April 23
2006 01:51:

Thank you for the pointer, it pointed me to the right solution.

It looks like @ is the escape character that works for @,
rather than %40. On using the parse_url() function on the url,
the correct email username was returned for the user element in
the resulting array.

Cheers
Simon


Very good... I didn't realize that the server would recognize it in that
fashion. You could probably use urldecode() for getting the %40 out of it,
did you try it that way?

If you do, I'd be curious to see the result. I don't have the ambition to
code that up for a test right now, since I've got other things keeping my
plate rather full at the moment... <G>

- Mike
Apr 23 '06 #7
Gordon Burditt:
I did. Remember that USENET transmission is not instantaneous.
Also, article composition takes time. It used to be that a feed
that was getting articles 3 days old from the far side of the net
(consisting largely of UUCP feeds) was operating unusually better
than normal.

Even now, I doubt that even all well-connected servers get a posted
article within 2 hours of when it is posted on one of them.


And some articles simply don't arrive on some servers.

Besides, it seems the original poster somehow misconstrued Michael's
followup and has now confused the HTML notation @ with the
percent-encoding %40.

It is now necessary to point out that @ is a way of representing
<@> *in* *HTML*, not in URLs (it means something very different in
URLs), and that as far as the URL is concerned, <@> is still
"unescaped". %40 (for the third time :-) is the percent-encoding of
<@>.

--
Jock

Apr 23 '06 #8
Michael B. Trausch wrote:
Gordon Burditt wrote in <12*************@corp.supernews.com> on Sat April 22
2006 23:18:

I am trying to use the basic http://user:pa******@example.com
form for authentication inside a script.

My only problem is my username contains the @ character (its an
email address). As result, the url seems to be parsing
incorrectly.

Has anyone found a way around this problem?


You may be able to use something like
http://username%40hotmail.com:pa******@example.com

where @ is converted to %40 . The same approach may apply if the
password contains odd characters like @, colon, space, %, etc.

Gordon L. Burditt

FYI, you may want to read to ensure that the question hasn't been answered
the same way you're about to answer it. It is bad form; the question was
answered twelve minutes prior to you posting the same thing.

Regards,
Mike


And it's even worse form to criticize someone for repeating the content of YOUR
OWN post 12 minutes after you posted it.

This is not a "I got the right answer first" contest. This is about helping
each other.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Apr 23 '06 #9
Gordon Burditt wrote in <12*************@corp.supernews.com> on Sun April 23
2006 00:13:
FYI, you may want to read to ensure that the question hasn't been answered
the same way you're about to answer it. It is bad form; the question was
answered twelve minutes prior to you posting the same thing.


I did. Remember that USENET transmission is not instantaneous.
Also, article composition takes time. It used to be that a feed
that was getting articles 3 days old from the far side of the net
(consisting largely of UUCP feeds) was operating unusually better
than normal.

Even now, I doubt that even all well-connected servers get a posted
article within 2 hours of when it is posted on one of them.


My apologies. I didn't realize that there would've been that large of an
amount of lag between the servers.

- Mike
Apr 23 '06 #10
Michael B. Trausch <mi*********************@comcast.net> wrote:

Very good... I didn't realize that the server would recognize it in that
fashion. You could probably use urldecode() for getting the %40 out of it,
did you try it that way?

If you do, I'd be curious to see the result. I don't have the ambition to
code that up for a test right now, since I've got other things keeping my
plate rather full at the moment... <G>

- Mike


Another solution I've discovered, that is probably more flexible
inside a script, is to use the Snoopy php class:

http://sourceforge.net/projects/snoopy/

Snoopy acts like a web browser inside the script, so username and
password can be set as properties of the class, and sent to the
server requiring basic authentication.

The results are then returned as an array.

Cheers
Simon

--
Stupendous Tales
www.stupendoustales.com
Speculative Fiction, Pulp Dreams
Apr 23 '06 #11
Jerry Stuckle wrote in <Kt******************************@comcast.com> on Sun
April 23 2006 11:50:

And it's even worse form to criticize someone for repeating the content of
YOUR OWN post 12 minutes after you posted it.

This is not a "I got the right answer first" contest. This is about
helping each other.


I agree with you on that. Now, I didn't realize that the lag was 12 whole
minutes -- that's atypical for many networks these days, even Usenet.
Often, I can post something to Usenet and find it on Google Groups within
five minutes of my having posted it. Thus, it didn't seem unreasonable to
me to prompt Gordon to check prior to posting. It would seem that he is
not to blame for not checking; rather, his NNTP spooling service is a bit
behind on getting the feeds from Usenet.

Looking at their web site, it could also be a slowdown caused by their
Usenet spam filtration software or something similar; either way, that's a
great deal of lag. :( It isn't the 1980s anymore. <g>

- Mike
Apr 23 '06 #12
Michael B. Trausch wrote:
Jerry Stuckle wrote in <Kt******************************@comcast.com> on Sun
April 23 2006 11:50:
And it's even worse form to criticize someone for repeating the content of
YOUR OWN post 12 minutes after you posted it.

This is not a "I got the right answer first" contest. This is about
helping each other.

I agree with you on that. Now, I didn't realize that the lag was 12 whole
minutes -- that's atypical for many networks these days, even Usenet.
Often, I can post something to Usenet and find it on Google Groups within
five minutes of my having posted it. Thus, it didn't seem unreasonable to
me to prompt Gordon to check prior to posting. It would seem that he is
not to blame for not checking; rather, his NNTP spooling service is a bit
behind on getting the feeds from Usenet.

Looking at their web site, it could also be a slowdown caused by their
Usenet spam filtration software or something similar; either way, that's a
great deal of lag. :( It isn't the 1980s anymore. <g>

- Mike


Not atypical at all, Mike. It all depends on how often usenet servers sync with
each other, how many servers are between the posting one and the receiving one,
any network delays which can creep in, and even if a router is temporarily down
for maintenance.

12 minutes is nothing. I, too, have regularly seen delays of 2 hours or more.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Apr 23 '06 #13

Jerry Stuckle wrote:
Michael B. Trausch wrote:
Jerry Stuckle wrote in <Kt******************************@comcast.com> on Sun
April 23 2006 11:50:
And it's even worse form to criticize someone for repeating the content of
YOUR OWN post 12 minutes after you posted it.

This is not a "I got the right answer first" contest. This is about
helping each other.

I agree with you on that. Now, I didn't realize that the lag was 12 whole
minutes -- that's atypical for many networks these days, even Usenet.
Often, I can post something to Usenet and find it on Google Groups within
five minutes of my having posted it. Thus, it didn't seem unreasonable to
me to prompt Gordon to check prior to posting. It would seem that he is
not to blame for not checking; rather, his NNTP spooling service is a bit
behind on getting the feeds from Usenet.

Looking at their web site, it could also be a slowdown caused by their
Usenet spam filtration software or something similar; either way, that's a
great deal of lag. :( It isn't the 1980s anymore. <g>

- Mike


Not atypical at all, Mike. It all depends on how often usenet servers sync with
each other, how many servers are between the posting one and the receiving one,
any network delays which can creep in, and even if a router is temporarily down
for maintenance.

12 minutes is nothing. I, too, have regularly seen delays of 2 hours or more.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================


Just blame slow typing and everyone get along with your lives.

Apr 24 '06 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: frizzle | last post by:
Hi there! I have (for sofar) a small problem: I have a site, with mySQL-backend, and an online admin system. The site is in three languages: 1 of them is German. My poblem concerns the 'ß'...
0
by: victor | last post by:
Hi, I used Cookies to store username. In a Windows98 client, I typed some Chinese characters into the login box in login.asp. After submit, in c.asp, the username is stored in the cookies....
8
by: turnit \(removethis\) | last post by:
I have a login form that uses the post method to carry the information to the next page. The form works just fine in ie6.0, but fails in mozilla and fails in ie5.2 on a mac. "HTTP/1.1 400 Bad...
5
by: J P Singh | last post by:
Hi All We have an application which uses surname and the date of birth to allow people to login. The SQL gives an error if the user's surname contains the character ' Anybody knows a way...
2
by: Rujuta Gandhi | last post by:
Hi All, I am facing a very crucial problem. Im developing a web application using .net studio 2005(beta). I want my Login.aspx page to be secured(https) for encrypted login information...
2
by: Greg Buckley | last post by:
I have come across an interesting problem. Let me first state that I am not a fluent ASP programmer. I am a network engineering trying to port an existing app. The app in question is currently...
6
by: jasn | last post by:
Hello I am getting the following error message when I try and send an XML sting to a web service, I read somewhere that most web services prefer ascii and some throw errors when using unicode so...
2
by: Dave Siegel | last post by:
Hi, I'm making a browser for a game and for the login you need to fill in you're e-mail adress. I know how the login works and how to make that with vb. But i need to know how to replace the @...
4
by: Freedolen | last post by:
Hi All, I had a perl script which is used to login in a web page, but it gives the error as "301 Moved Permanently". What does this means and how can it be rectified? Can anyone help on this? ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.