# Flow for SPA to API and API to API

**URL:** <https://community.auth0.com/t/flow-for-spa-to-api-and-api-to-api/6587>\
**Category:** Get Help\
**Tags:** spa, api, client-credentials-g\
**Created:** [May 12, 2017, 12:39am UTC](https://community.auth0.com/t/flow-for-spa-to-api-and-api-to-api/6587 "2017-05-12T00:39:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![trondhindenes](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/trondhindenes/32/6352_2.png) [@trondhindenes](https://community.auth0.com/u/trondhindenes)\
**Post date:** [May 12, 2017, 12:39am UTC](https://community.auth0.com/t/flow-for-spa-to-api-and-api-to-api/6587/1 "2017-05-12T00:39:54Z")

</div>

We have a bunch of administrative apis where we’re using Aurelia and Lock on the frontend to access them, and this works really well. The problem is that we’d also like to script against the same api using a multitude of scripting tools (these will be both interactive and non-interactive (eg api-to-api).

While could sorta get away with our current lock-based solution in interactive mode by having the user first grab his/her access token from an authenticated (SPA) session, this wouldn’t work in an api-to-api setting.

As far as I can see from the docs, the recommended way by auth0 is to create a separate auth0 client for each api that needs access to my “backend api”, but this solution seems fairly dreadful in terms of management - we’d end up with who knows how many clients.

Am I missing something, or is this the recommended (and only?) approach? I guess I’d really like to be able to create named users representing my “client apis” and somehow store api keys for each user instead - but from what I’ve seen that’s not currently an option with Auth0.

I’d appreciate if someone could confirm my assumptions.

---

<div class="post-metadata">

**Author:** ![trondhindenes](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/trondhindenes/32/6352_2.png) [@trondhindenes](https://community.auth0.com/u/trondhindenes)\
**Post date:** [May 12, 2017, 12:45am UTC](https://community.auth0.com/t/flow-for-spa-to-api-and-api-to-api/6587/2 "2017-05-12T00:45:21Z")

</div>

So after writing this I come across the new “api” section in the management thingy. Will study there and then update/resolve the question.

---

<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:** [May 17, 2017, 4:17pm UTC](https://community.auth0.com/t/flow-for-spa-to-api-and-api-to-api/6587/3 "2017-05-17T16:17:39Z")

</div>

@trond did the docs clarify your situation or are you still looking for additional guidance?

---

<div class="post-metadata">

**Author:** ![trond.hindenes](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/trond.hindenes/32/6352_2.png) [@trond.hindenes](https://community.auth0.com/u/trond.hindenes)\
**Post date:** [May 19, 2017, 11:57pm UTC](https://community.auth0.com/t/flow-for-spa-to-api-and-api-to-api/6587/4 "2017-05-19T23:57:15Z")

</div>

@jmangelo definetely, this is a very nice improvement. I guess I’d still like some way to separate an “api client” from a “client app”, but this is a definite improvement anyways. Thanks for reaching out!

---

<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:** [May 24, 2017, 5:42pm UTC](https://community.auth0.com/t/flow-for-spa-to-api-and-api-to-api/6587/5 "2017-05-24T17:42:18Z")

</div>

As you come across in the documentation the recommendation is indeed to have a specific (non-interactive) client application to represent the API to API calls.

In relation to your comment about having a separation between _API clients_ and _normal_ client applications there’s some separation although the separation is not reflected in the Dashboard in terms of different screen. When you create an _API client_ you should be setting its client type as _Non Interactive_ so there’s is indeed some level of separation (based on the client type).

---

<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:53am UTC](https://community.auth0.com/t/flow-for-spa-to-api-and-api-to-api/6587/6 "2018-03-02T05:53:51Z")

</div>


