B4J Question B4J WebView Login Issue

Swissmade

Well-Known Member
Licensed User
Longtime User
In B4A you have a event Webview1_UserAndPasswordRequired when it comes to Login.
I have not found this in the B4J version.

Somebody any idea about this.

Thanks
 

Swissmade

Well-Known Member
Licensed User
Longtime User
This is currently not possible without writing a small library. If you like to build such library I can guide you.
Interesting.
Something like JWebView-Extra
In which language has this library to be written Erel?
 
Upvote 0

Swissmade

Well-Known Member
Licensed User
Longtime User
Java.

You need to create a class with this code:
B4X:
  public void SetUserAndPassword(final String user, final String password) {
     Authenticator.setDefault(new Authenticator() {
        protected PasswordAuthentication getPasswordAuthentication() {
        return new PasswordAuthentication(user, password.toCharArray());
        }
     });
   }
Nice but I think this has to go in the WEBview class. Bad that i'm not so good in Java to do this:(
 
Upvote 0

Swissmade

Well-Known Member
Licensed User
Longtime User
Hi Erel,
Good news its working.
I have build a Library called HTTPAuth in Eclipse.
Please if you like test this. For me it is working at the moment.
Wondering what's happening when I need different logins.
 

Attachments

  • jHttpAuth.zip
    2.2 KB · Views: 322
Upvote 0
Top