Call a WebService with authentication

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

Call a WebService with authentication

angelo.favero
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.
Reply | Threaded
Open this post in threaded view
|

Re: Call a WebService with authentication

Paul DeBruicker
ZnClient new
      url: 'https://www.example.com';
      username: 'myuser' password: 'mypwd';
      get
 


angelo.favero wrote
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.