# Script Mapper - Read data from client request

**URL:** <https://forum.keycloak.org/t/script-mapper-read-data-from-client-request/8146>\
**Category:** Getting advice\
**Tags:** admin-console, oidc\
**Created:** [March 25, 2021, 7:28pm UTC](https://forum.keycloak.org/t/script-mapper-read-data-from-client-request/8146 "2021-03-25T19:28:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![caetalm](https://avatars.discourse-cdn.com/v4/letter/c/65b543/32.png) [@caetalm](https://forum.keycloak.org/u/caetalm)\
**Post date:** [March 25, 2021, 7:28pm UTC](https://forum.keycloak.org/t/script-mapper-read-data-from-client-request/8146/1 "2021-03-25T19:28:07Z")

</div>

Hi all!

I’m trying to build a script using Script Mapper. Basically, I need to read some data from the body of the request that was made by the client and add it as a claim to the access token.

I read the docs, but didn’t quite figure it out, is it possible?

---

<div class="post-metadata">

**Author:** ![caetalm](https://avatars.discourse-cdn.com/v4/letter/c/65b543/32.png) [@caetalm](https://forum.keycloak.org/u/caetalm)\
**Post date:** [March 25, 2021, 8:03pm UTC](https://forum.keycloak.org/t/script-mapper-read-data-from-client-request/8146/2 "2021-03-25T20:03:00Z")

</div>

nvm, the following code did the trick:

```
var req = keycloakSession.getContext().getContextObject(Java.type("org.jboss.resteasy.spi.HttpRequest").class);
exports = req.getDecodedFormParameters().getFirst("my-param");
```
