# ClientAuthenticator and UserSessionNote

**URL:** <https://forum.keycloak.org/t/clientauthenticator-and-usersessionnote/23372>\
**Category:** Extending the server\
**Tags:** authentication\
**Created:** [November 16, 2023, 7:47am UTC](https://forum.keycloak.org/t/clientauthenticator-and-usersessionnote/23372 "2023-11-16T07:47:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gridy](https://avatars.discourse-cdn.com/v4/letter/g/a8b319/32.png) [@Gridy](https://forum.keycloak.org/u/Gridy)\
**Post date:** [November 16, 2023, 7:47am UTC](https://forum.keycloak.org/t/clientauthenticator-and-usersessionnote/23372/1 "2023-11-16T07:47:37Z")

</div>

Hello,

I extended the JWTClientAuthenticator class (Keycloak 18.0.2) and I’m trying to add info in the User Session Note (knowing that I’m using a service account).

> public void authenticateClient(ClientAuthentificationFlowContext context) {  
> …  
> context.getSession().getContext().getAuthenticationSession().setUserSessionNote(“key”,“value”);

However AuthenticationSession is systematically null. Do you have an idea ? My approach is wrong ?  
Perhaps at this stage of authentication the session is not yet created?

Thank you
