简体   繁体   English

Java(RMI)服务器到服务器的身份验证方法?

[英]Java (RMI) server-to-server authentication methods?

I'm working on a server-to-server authentication via RMI. 我正在通过RMI进行服务器到服务器身份验证。 There's on application-server (server part) and several web-servers (client part) which communicate via RMI. 有应用程序服务器(服务器部分)和几个通过RMI进行通信的Web服务器(客户端部分)。 The web-server(s) must authenticate on the application-server. Web服务器必须在应用程序服务器上进行身份验证。 The simplest way would be to use a password which is stored in the web-server's config-file (clear text), but that's obviously very bad practice. 最简单的方法是使用存储在web服务器的配置文件(明文)中的密码,但这显然是非常糟糕的做法。

My idea is to use a public/private-key which is generated on the web-server (client). 我的想法是使用在Web服务器(客户端)上生成的公钥/私钥。 The privateKey is stored in keystore and the publicKey is published to the app-server. privateKey存储在密钥库中,publicKey发布到app-server。 To authenticate the client, a generated, random String is signed with the privateKey (create a Signature) and both, the signature und the String are send to the server. 要对客户端进行身份验证,使用privateKey(创建签名)对生成的随机String进行签名,并将签名和字符串发送到服务器。 The server verifies the String with the signature and it's publicKey. 服务器使用签名验证String,它是publicKey。
Good idea? 好主意?
I know this is not very secure but even better than storing clear text password. 我知道这不是很安全,但比存储明文密码更好。

Any suggestions for that? 有什么建议吗?
There's no need to make it 100% secure, just a good alternative for password protection. 没有必要让它100%安全,只是密码保护的一个很好的替代品。

Thanks and have a nice day. 感谢,并有一个愉快的一天。

Public /private key encryption should be good enough. 公钥/私钥加密应该足够好。 Other alternatives would be to store the password in an LDAP server and give access to both the server as well as the clients to the LDAP. 其他替代方法是将密码存储在LDAP服务器中,并允许访问服务器以及LDAP的客户端。 However, this would add a burden of one more server and some more network usage. 但是,这会增加一个服务器和一些网络使用的负担。 The ultimate security will be to use Secure RMI, this will protect your RMI messages as well as protect the connections to the server. 最终的安全性将是使用安全RMI,这将保护您的RMI消息以及保护与服务器的连接。

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

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