#OAuth2 Flows#
OAuth2 Flows
Authorization code grant
###Authorization code grant### TheThe Authorization code grant flow is used where not only the user needs to authenticate to gain access to a protected resouce but so does the 3rd party application. This means only applications you have approved in advance can act on the users behalf
Implicit Grant flow
###Implicit Grant flow### ThisThis flow is used when either the client secret and client ID can't be protected (that being if they wouldn't be held on a server but would be distributed as an application) or you explicitly want non preapproved applications to be able to act on the users behalf
Resource Owner Password Credentials
###Resource Owner Password Credentials### InIn this case the 3rd party app collects the credentials and then passes them onto you. If you're thinking that the 3rd party app could also email them to a hostile party; you're absolutely correct, they could. But sometimes this is the only practical implementation (e.g. a mobile app - although it is technically possible to use the Implicit Grant flow with a mobile app it is clunky)
Your Scenarios
#Your Scenarios# II can see 2 things you want to protect; the public REST endpoints and the private web services.
###public REST endpoints###
public REST endpoints
###Private web services###
Private web services
#Authorisation and authentication.
Authorisation and authentication.
#Who holds the tokens