Passing password expiration information from the Wildfly Server authentication module to the remote EJB client

We have a Wildfly 10 JEE application and a java-fat client that uses remote EJ calls to communicate with the server. Authentication is performed using a custom wildfly server login module.

Now we have a requirement to improve this login module with the concept of password expiration. Whenever the password expires, the user must change his password during the login process. The login module uses JAAS callbacks and the JAAS callback handler. As I understand it, we could use javax.security.auth.callback.TextInputCallback in our LoginModule to request a new password from the user during login.

How it integrates with deletion. How does our fat client get a TextInputCallback to provide the requested input? I think we need to register a custom CallbackHandler on the client side that handles callbacks, but I have not found any documentation on how to do this with Wildfly. Can someone give me a hint of such documentation or a sample of how to solve this problem?

+6
source share
1 answer

In my opinion, you are going in the wrong direction. Using your LoginModule password change approach has some problems.

  • "" , "" .
  • TextInputCallback , , . TextInputCallback , , , PIN- ( ) , CallbackHandler, , , , scren.
  • LoginModule - LoginModule / .

, / , , , . xxxCallback .

Exceptions , CredentialExpiredException, , . , Oracle WebLogic JAAS

, / LoginModule, Callback PasswordChangeCallback ConfirmPasswordCallback, NewPasswordCallback, VerifyNewPasswordCallback

LoginModule, . , . CallbackHandler.

JAAS CallbackHander * CallbackHandler

API CallbackHandler

CallbackHandler auth.login.defaultCallbackHandler. Java, /lib/security/java.security. java.home , JRE.

LoginContext. LoginContext , CallbackHandler

public LoginContext(String name, CallbackHandler callbackHandler)
       throws LoginException


public LoginContext(String name, Subject subject,
       CallbackHandler callbackHandler) throws LoginException

. API LoginContext

?

, . .

TextInputCallback?

CallbackHandler PasswordCallback. , Login CallbackHandler.

  void  handle(Callback[] callbacks)

, handle, CallbackHandler API CallbackHandler handle.

+4

Source: https://habr.com/ru/post/1017292/


All Articles