I have created on CustomAuthenticator as below:
public class MyCustomAuthenticator extends UsernamePasswordForm {
@Override
public boolean validatePassword(final AuthenticationFlowContext context, final UserModel user,
final MultivaluedMap<String, String> inputData, final boolean clearUser) {
context.getSession().setAttribute("data","test");
}
}
but when i tried to get it on protocol mapper as below:
public class RmDataTokenMapper extends AbstractOIDCProtocolMapper implements OIDCAccessTokenMapper, OIDCIDTokenMapper, UserInfoTokenMapper {
@Override
protected void setClaim(IDToken token, ProtocolMapperModel mappingModel, UserSessionModel userSession, KeycloakSession keycloakSession, ClientSessionContext clientSessionCtx) {
keycloakSession.sessions().getKeycloakSession().getAttribute("data");
}
}
I am not able to get data. Any one help me how to achieve?