Set and update Keycloak/OpenId-Connect Claims in Client application

I’d like to know if and how it is possible to set and update Keycloak (OpenID-Connect) AccessToken or IdToken attributes (so called Claims) by a client web application, after successful authentication.

The use case is to add specific user-attributes (e.g. number of pets, hair color, favorite car, etc.) to the Access- or Id-Token, while the user is logged in to our web application based on a Vue.js Frontend and a SpringBoot Backend, mainly exposing REST Services to the Frontend.
A second web-application, also using the Keycloak Token for user authentication/authorization (Single-Sign-On feature) should be able to read the user-attributes added by the first web-application to the Token.

Even I’m afraid that adding and changing of Token payload is not allowed by architectural design of OpenId-Connect, I nevertheless hope it will be possible anyhow.

Token-attributes are implemented as ‘Claims’ in OpenId-Connect. And Keycloak supports ‘Claim’ mappings during the authentication process (set by static mappings on Keycloak server as well as by code that runs on the Keycloak server).

The appropriate methods to set and get Claim key-value pairs are mentioned by the following articles:

token.getOtherClaims().put("myClaimName", "claim value");

Map<String, Object> otherClaims = token.getOtherClaims();
if (otherClaims.containsKey("myClaimName")) {
  String claimValue = String.valueOf(otherClaims.get("myClaimName"));

For the case changing of Token payload by Keycloak clients is not allowed by architectural design, I appreciate any suggestion on best practices to hand over dynamically added user-attributes from one webapp to another webapp, having the same Keycloak Access- and/or Id-Token in common.