1

I apologize if this has been answered, but I have been searching for hours, and still don't quite understand. This is a specific question, and not a "which is best" question.

Specific questions are in italic.

I have created a RESTful API, which was at first meant to be completely open. However, the organization has now decided to create a first-party mobile app to consume and (to some degree) update the data.

I am investigating authentication frameworks (oAuth2), and was not sure if oAuth2 was the correct way to go to meet our goals. And, if it is, which Authorization Grants applied to which set of users.

Our goals are:

  • To allow users to login and create accounts in the first-party app, entirely through oAuth 2 providers (twitter, facebook, google). These users would have access to the greatest set of data via the first-party app.
  • Assign different roles to the users (admin, moderator, etc).
  • Allow other applications to register, receive token credentials, and have limited write access or expanded access to the data. This would open them for creating third-party apps or research systems.
  • Finally, we would like to keep some of the data completely open, with no authentication needed.

So, am I right in assuming that we want to setup an oAuth2 *Server* (Authorization and Resource Server)?

If so, which Authorization Grants apply to the above situations?

One last question: For users using the first party app, would the app be responsible for logging them in and keeping their access credentials? The API server serves NO html, and is 100% RESTful. Does it need to serve login forms?

Cœur
  • 32,421
  • 21
  • 173
  • 232
Apollo
  • 821
  • 1
  • 7
  • 22

1 Answers1

1

If you need to both authenticate and authorize users to your API based on various OAuth2 social logins, you do need some kind of API server or service where you can define your users and groups/role and the scopes that are available to users based on your rules.

Some cloud-hosted options for this are:

If you integrate with a service such as the ones above, you can let the service take care of authenticating users and just make sure that every user call checks against the service first for permission before it goes ahead and does anything.

lukwam
  • 424
  • 3
  • 12