Actions
Bug #6252
closedHTTP with UserPass context
Status:
Resolved
Priority:
High
Assigned To:
Category:
Non-grid adaptors
Target version:
Start date:
02/24/2014
Due date:
% Done:
0%
Estimated time:
Description
Dear Developers,
JSAGA's HTTP offers UserPass authentication as a valid context type,
but I don't see userpass data in HTTP header,
and I cannot access pages like: http://svn.liferay.com/repos/public/ with user: "guest", pass: "".
The sent header should contain the entry:
Authorization: Basic Z3Vlc3Q6
where Z3Vlc3Q6 is the base64 encoded form of user:pass string ("guest:" in this example).
(There are authentication types in HTTP other than Basic, but I would be satisfied with Basic.)
Now I get: NoSuccess: HTTP/1.1 401 Authorization Required.
Thank you,
Akos
Example code producing this error:
import org.ogf.saga.context.*; import org.ogf.saga.namespace.*; import org.ogf.saga.session.*; import org.ogf.saga.url.*; public class HttpUserPass { public static void main(String[] args) throws Exception { String url = "http://svn.liferay.com/repos/public/"; Session session = SessionFactory.createSession(false); Context ctx = ContextFactory.createContext("UserPass"); ctx.setAttribute(Context.USERID, "guest"); ctx.setAttribute(Context.USERPASS, ""); session.addContext(ctx); URL dirUrl = URLFactory.createURL(url); NSDirectory dir = NSFactory.createNSDirectory(session, dirUrl); for (URL dirEntry: dir.list()) System.out.println(dirEntry.getPath()); dir.close(); } }
Updated by Schwarz Lionel about 11 years ago
- Category set to Non-grid adaptors
- Assigned To set to Schwarz Lionel
- Priority changed from Normal to High
- Target version set to 1.0.1
Updated by Schwarz Lionel about 11 years ago
- Status changed from New to Resolved
Actions