Reputation: 40042
We are a developing an AngularJS single page application with an ASP.NET Web Api 2 REST API. We are using OWIN middleware and OAuth, but are still unsure if we are taking the correct approach.
Our system consists of clients and users:
Should we be returning the clientId
at this point?
The AngularJS front-end layer does need this clientId
to perform other resource calls. For example:
api/clients/2345/orders
api/clients/2345/orders/522
api/clients/2345/departments
Upvotes: 1
Views: 788
Reputation: 7394
If you are working with companies, the active directory approach to SPAs (and Angular specifically) might be a good fit: you can use http://www.cloudidentity.com/blog/2014/10/28/adal-javascript-and-angularjs-deep-dive/ as a starting point. The token acquisition and use are fully abstracted there.
Upvotes: 1