简体   繁体   English

jave ee 7应用程序客户端glassfish 4 jdbc领域

[英]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. 我想创建一个连接到EJB项目的Swing应用程序客户端,该项目将具有到安全客户端会话的登录方法。

When the client is run, you will provide a username and password , and thus login. 运行客户端时,您将提供usernamepassword ,然后登录。 However, if you type the incorrect password, you can be given n tries to provide the credentials. 但是,如果您输入了错误的密码,则可以尝试输入n次以提供凭据。

I have configured Glassfish 4 to work with jdbc realm. 我已将Glassfish 4配置为与jdbc领域一起使用。 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. Jave EE7提供了一种使用用户名和密码来请求用户的方法,但是我希望对不正确的密码和登录有更多的控制权。

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. 答案取决于您使用哪个HTTP客户端以及服务器支持哪种身份验证类型。 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. 检查您的HTTP客户端可以遵循HTTP重定向。 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. 如果将其保存在cookie中,则需要将其存储在客户端中,并随每个请求手动发送到服务器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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