How to invoke web service with authentication

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

How to invoke web service with authentication

angelo.favero
online
1 post
This post was updated on Mar 22, 2016; 8:48pm.
Hi, all.

I'm calling a web service with java using this java code to authenticate.

---------------------------------------------------------------------------------------------------------------------
Authenticator authenticator = new Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
String user = "myuser";
String password = "mypwd";
System.out.println("Feeding username and password");
PasswordAuthentication auth = new PasswordAuthentication(user, password.toCharArray());
return auth;
}};
Authenticator.setDefault(authenticator);
--------------------------------------------------------------------------------------------------------------------

I'm looking for an example of smalltak code that does the same thing.