Download
Magazine
Develop
Account
Download
Magazine
Develop
Login
Forgot Account/Password
Create Account
Language
Help
Language
Help
×
Login
Login Name
Password
×
Forgot Account/Password
Category:
Software
People
PersonalForge
Magazine
Wiki
Search
OSDN
>
Find Software
>
Software Development
>
Interpreters
>
Mysaifu JVM
>
Ticket List/Search
>
Ticket #12418
Mysaifu JVM
Description
Project Summary
Developer Dashboard
Web Page
Developers
Image Gallery
List of RSS Feeds
Activity
Statistics
History
Downloads
List of Releases
Stats
Source Code
Code Repository list
Subversion
View Repository
Ticket
Ticket List
Milestone List
Type List
Component List
List of frequently used tickets/RSS
Submit New Ticket
Documents
Communication
list of ML
mysaifujvm-announce
News
Ticket #12418
Ticket List
Submit New Ticket
RSS
java.net.Authenticator doesn't work
Open Date:
2008-04-27 11:46
Last Update:
2008-04-29 12:02
monitor
ON
OFF
Reporter:
(Anonymous)
Owner:
freebeans
Type:
Bugs
Status:
Open [Owner assigned]
Component:
v0.3.7
MileStone:
(None)
Priority:
5 - Medium
Severity:
5 - Medium
Resolution:
Accepted
File:
None
Details
The following lines of code add HTTP BASIC
Authentication Header Token to the http request
message, like
"Authorization: Basic base64encoded(username:password)".
The code works fine under desktop JVM, while in
mysaifu, 401 UNAUTHORIZED is returned.
Authenticator.setDefault(new Authenticator() {
protected PasswordAuthentication
getPasswordAuthentication() {
return new PasswordAuthentication
(username, password.toCharArray());
}
});
Ticket History (3/3 Histories)
2008-04-28 09:44
Updated by:
freebeans
Owner
Update from
(None)
to
freebeans
Resolution
Update from
None
to
Accepted
2008-04-29 10:41
Updated by:
freebeans
Comment
Logged In: YES
user_id=14530
I checked source code of gnu.java.net package, I'm not sure
bug it seems that GNU Classpath does not support
java.net.Authenticator.
2008-04-29 12:02
Updated by: None
Comment
Logged In: NO
No biggie. I have a workaround of adding an HTTP BASIC
Authentication header via java.net.HttpURLConnection class
as follows,
httpURLConnection.setRequestProperty("Authorization",
"Basic
"+Base64.encodeBytes((username+":"+password).getBytes()));
along with the Base64 class from here,
http://iharder.sourceforge.net/current/java/base64/
Thanks
Attachment File List (
0
)
Attachment File List
No attachments
Edit
Please login to add comment to this ticket »
Login
Authentication Header Token to the http request
message, like
"Authorization: Basic base64encoded(username:password)".
The code works fine under desktop JVM, while in
mysaifu, 401 UNAUTHORIZED is returned.
Authenticator.setDefault(new Authenticator() {
protected PasswordAuthentication
getPasswordAuthentication() {
return new PasswordAuthentication
(username, password.toCharArray());
}
});