Automatically open a link in browser and login using java -
i'm trying find way using java code, provide url, username , password , code automatically opens link in browser , login without me having provide credentials again in browser when link opens. there way ?
you can pass username , password through parameters such as:
mysite.com/login?username=user&password=user
then can extract parameters request , use them authentication:
@requestmapping("login") public string login(@requestparam(required=false) string username, @requestparam(required=false) string password) { if(username != null && password != null) { //perform auth } return "login"; }
but better way associate unique token each user , login them based on that.
//p.s. opening browser specified url can use: open link in browser java button?
Comments
Post a Comment