# Device name for Resource Owner Password flow (Java)

**URL:** <https://community.auth0.com/t/device-name-for-resource-owner-password-flow-java/7853>\
**Category:** Get Help\
**Tags:** refresh\_token, resource-owner-passw\
**Created:** [August 15, 2017, 5:21pm UTC](https://community.auth0.com/t/device-name-for-resource-owner-password-flow-java/7853 "2017-08-15T17:21:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![AndreasJScholz](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@AndreasJScholz](https://community.auth0.com/u/AndreasJScholz)\
**Post date:** [August 15, 2017, 5:21pm UTC](https://community.auth0.com/t/device-name-for-resource-owner-password-flow-java/7853/1 "2017-08-15T17:21:54Z")

</div>

I am using the auth0-java library and want to generate refresh tokens using the offline\_access scope

If authentication succeeds the token will show in the dashboard user → devices tab correctly (counter will increment)

However I cannot figure out how to specify the “name” shown there. Using the java API it will always be “okhttp”. Doing some testing it seems like it is always the “user-agent” http header that is taken as device name (i.e. I can force a different name by specifying a different “user-agent”)

Using the legacy API it was possible to specify this name using the “device” parameter but this does not seem to have any effect anymore (i.e. adding the parameter to the request changes nothing)

Is there some way to specify the name in the authentication request? Working around with the “user-agent” http header seems very cumbersome, especially as there is no easy way to access the raw okhttp requests via the java library

---

<div class="post-metadata">

**Author:** ![jdram.es](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@jdram.es](https://community.auth0.com/u/jdram.es)\
**Post date:** [October 19, 2017, 10:46am UTC](https://community.auth0.com/t/device-name-for-resource-owner-password-flow-java/7853/2 "2017-10-19T10:46:05Z")

</div>

Were you every able to resolve this issue or find a suitable workaround? I have been wanting to do this as well.

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [December 13, 2017, 7:38pm UTC](https://community.auth0.com/t/device-name-for-resource-owner-password-flow-java/7853/3 "2017-12-13T19:38:52Z")

</div>

As you pointed out the use of the device name is associated with the legacy authentication endpoints that would allow to explicitly specify them. In the non-legacy endpoints that capability is not available, however, due to the fact that both legacy and non-legacy endpoints need to co-exist until the deprecated functionality is removed what you see currently is that there is some information automatically used in order to still display some information. Having said that I confirmed that if you’re using the non-legacy endpoints trying to leverage anything that’s associated with the device name functionality is not recommended.

In conclusion, device is a remnant of legacy authentication endpoints and should only be used if you still haven’t migrated from those legacy endpoints.

---

<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:55am UTC](https://community.auth0.com/t/device-name-for-resource-owner-password-flow-java/7853/4 "2018-03-02T05:55:56Z")

</div>


