# Client token in server authentication flow

**URL:** <https://community.auth0.com/t/client-token-in-server-authentication-flow/8773>\
**Category:** Get Help\
**Tags:** spring-security\
**Created:** [November 18, 2017, 11:20am UTC](https://community.auth0.com/t/client-token-in-server-authentication-flow/8773 "2017-11-18T11:20:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![peavers](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/peavers/32/7448_2.png) [@peavers](https://community.auth0.com/u/peavers)\
**Post date:** [November 18, 2017, 11:20am UTC](https://community.auth0.com/t/client-token-in-server-authentication-flow/8773/1 "2017-11-18T11:20:49Z")

</div>

Hello,  
I’m having issues authenticating my backend with the token I receive from Auth0 in my front end client.

Using [emberjs-simple-auth-auth0](https://github.com/auth0-community/ember-simple-auth-auth0) I correct receive a token and authenticate on the frontend. However using that same token I’m unable to get my backend to accept incoming requests.

I’m using [auth0-spring-security-api](https://github.com/auth0/auth0-spring-security-api) on my backend application. I think I might have just configured my auth0 dashboard incorrectly?

Looking at the access token returned from the frontend it looks something like `svfyTcAAqHbIdppi_zkJHkldW2jhJKF3` so if I take that and put it into a curl request to the backend

```
curl -X GET -H "Authorization: Bearer svfyTcAAqHbIdppi_zkJHkldW2jhJKF3" -H "Cache-Control: no-cache" "http://192.168.0.109:39885"

```

I get a 401 from my backend.

All I’ve done in the dashboard is create a API, which automatically created me a non-interactive test client, so I’ve used that client ID in my frontend.

I get the sense this isn’t the correct client type to use?

---

<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:** [November 20, 2017, 7:42pm UTC](https://community.auth0.com/t/client-token-in-server-authentication-flow/8773/2 "2017-11-20T19:42:55Z")

</div>

Based on the information you provided you configured you API back-end (aka resource server) correctly in the Auth0 Dashboard, but then did not do the same for the client application front-end. In particular, like you mentioned the non-interactive test client is not suitable for the scenario at hand and you should configure a separate client application to represent your front-end.

The front-end makes use of Ember.js so it falls in the client-side application camp for which you should check:

- [Call APIs from Client-side Web Apps](https://auth0.com/docs/api-auth/grant/implicit)
- [How to implement the Implicit Grant](https://auth0.com/docs/api-auth/tutorials/implicit-grant)

If you follow the above you’ll notice that you’ll be sending an `audience` parameter during the authentication request and that the audience matches the API you configured. This will mean the client application will receive an access token suitable to call your API. At this time, this technically translates to a JWT access token that the API can validate by itself.

---

<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/client-token-in-server-authentication-flow/8773/3 "2018-03-02T05:57:27Z")

</div>


