# Can we send custom properties in the login request using the Java Library?

**URL:** <https://community.auth0.com/t/can-we-send-custom-properties-in-the-login-request-using-the-java-library/8641>\
**Category:** Get Help\
**Tags:** custom-property, request, token-endpoint\
**Created:** [November 1, 2017, 2:31am UTC](https://community.auth0.com/t/can-we-send-custom-properties-in-the-login-request-using-the-java-library/8641 "2017-11-01T02:31:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mpedersen](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/mpedersen/32/9084_2.png) [@mpedersen](https://community.auth0.com/u/mpedersen)\
**Post date:** [November 1, 2017, 2:31am UTC](https://community.auth0.com/t/can-we-send-custom-properties-in-the-login-request-using-the-java-library/8641/1 "2017-11-01T02:31:36Z")

</div>

Hello. We have a rule setup to check our login requests for a custom property named “x\_client\_id” that is passed in the request body to an /oauth/token call. However we are not able to add this property using the Java library from GitHub as there doesn’t seem to be a function to add custom properties to the auth.login(…) call. Everything works great using Postman.

```
POST /oauth/token
  {
        "grant_type": "http://auth0.com/oauth/grant-type/password-realm",
        "client_id": "xxx",
        "client_secret": "yyy",
        "username": "ggrissom@nasa.org",
        "password": "zzz",
        "scope": "openid profile offline_access",
        "realm": "Username-Password-Authentication",
        "audience": "https://xyz.auth0.com/userinfo",
        "x_client_id": "ANBC"
    }

```

Is there something that we aren’t seeing in the Java library? If not, is there any chance we could get something added in a newer version to do this? Maybe a function that accepts a Map of key/value pairs to add to the request body?

---

<div class="post-metadata">

**Author:** ![miro](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/miro/32/12765_2.png) [@miro](https://community.auth0.com/u/miro)\
**Post date:** [November 2, 2017, 6:09pm UTC](https://community.auth0.com/t/can-we-send-custom-properties-in-the-login-request-using-the-java-library/8641/2 "2017-11-02T18:09:32Z")

</div>

Maybe this has something to do with properly using (custom claims)[[OpenID Connect Scopes](https://auth0.com/docs/api-auth/tutorials/adoption/scope-custom-claims#custom-claims)] to pass custom data in the token for OIDC compliant apps?

---

<div class="post-metadata">

**Author:** ![mpedersen](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/mpedersen/32/9084_2.png) [@mpedersen](https://community.auth0.com/u/mpedersen)\
**Post date:** [November 2, 2017, 9:22pm UTC](https://community.auth0.com/t/can-we-send-custom-properties-in-the-login-request-using-the-java-library/8641/3 "2017-11-02T21:22:50Z")

</div>

No I’ve got the custom claims working perfectly. It’s more a limitation on the Java library. It would be handy if we could get another setter that took in a Map and would add the values in the map to the request. Maybe something like…

```
Map<String, Object> customProps = new HashMap<>();
customProps.put("x_client_id", "ABCD");

AuthRequest request = auth.login("me@domain.com", "password123", "Username-Password-Authentication")
        .setAudience("https://api.me.auth0.com/users")
        .setScope("openid contacts")
        .setCustomProperties(customProps);

```

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 2, 2018, 5:57am UTC](https://community.auth0.com/t/can-we-send-custom-properties-in-the-login-request-using-the-java-library/8641/4 "2018-03-02T05:57:14Z")

</div>


