简体   繁体   中英

jave ee 7 app client glassfish 4 jdbc realm

I want to create a Swing application client that connects to an EJB project which will have a login method to a secured client session.

When the client is run, you will provide a username and password , and thus login. However, if you type the incorrect password, you can be given n tries to provide the credentials.

I have configured Glassfish 4 to work with jdbc realm. Jave EE7 has a method to request user with the username and password, but I wanted have more control over the incorrect password and login.

Can someone please tell me how to do this ?

I tried using programmatic login but it does not seems to work.

You did not provide enough information. The answer depends on which HTTP client do you use and which authentication type is supported by the server. If the server supports form based authentication after the login it will redirect to the requested page. Check that your HTTP client can follow HTTP redirects. Also, you need to understand where the session token is kept. If it is kept in cookies you need to store it in client and send manually with each request to the server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM