# Connecting to the roles endpoint from a Rails app

**URL:** <https://community.auth0.com/t/connecting-to-the-roles-endpoint-from-a-rails-app/61606>\
**Category:** Get Help\
**Created:** [April 22, 2021, 7:52pm UTC](https://community.auth0.com/t/connecting-to-the-roles-endpoint-from-a-rails-app/61606 "2021-04-22T19:52:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![coraline](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/coraline/32/28972_2.png) [@coraline](https://community.auth0.com/u/coraline)\
**Post date:** [April 22, 2021, 7:52pm UTC](https://community.auth0.com/t/connecting-to-the-roles-endpoint-from-a-rails-app/61606/1 "2021-04-22T19:52:06Z")

</div>

We’ve got our Rails app connected to the Authentication API and everything is working fine. We’re running into a problem with retrieving roles, getting an “Expired token received for JSON Web Token validation” error. We’re passing through the Management API token in the authorization header, but from my reading I don’t think that’s correct.

Do we need to create a separate Application in the management console for a machine-to-machine application?

Any tips would be greatly appreciated. Thanks!

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [April 30, 2021, 9:04pm UTC](https://community.auth0.com/t/connecting-to-the-roles-endpoint-from-a-rails-app/61606/3 "2021-04-30T21:04:57Z")

</div>

Hi @coraline,

Welcome to the Community!

You should be able to request tokens for the management API in your rails app. How are you requesting the token? Is it in-fact expired?

---

<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:** [June 1, 2021, 5:07pm UTC](https://community.auth0.com/t/connecting-to-the-roles-endpoint-from-a-rails-app/61606/4 "2021-06-01T17:07:12Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
