It works by delegating user authentication to the service that hosts a user account and authorizing third-party applications to access that user account. OAuth 2 provides authorization flows for web and desktop applications, as well as mobile devices.
OAuth RolesOAuth defines four roles:
Resource Owner: The resource owner is the user who authorizes an application to access their account. The application’s access to the user’s account is limited to the scope of the authorization granted (e.g. read or write access)
Client: The client is the application that wants to access the user’s account. Before it may do so, it must be authorized by the user, and the authorization must be validated by the API.
Resource Server: The resource server hosts the protected user accounts.
Authorization Server: The authorization server verifies the identity of the user then issues access tokens to the application.
Here is a more detailed explanation of the steps in the diagram:
1.The application requests authorization to access service resources from the user
2.If the user authorized the request, the application receives an authorization grant
3.The application requests an access token from the authorization server (API) by presenting authentication of its own identity, and the authorization grant
4.If the application identity is authenticated and the authorization grant is valid, the authorization server (API) issues an access token to the application. Authorization is complete.
5.The application requests the resource from the resource server (API) and presents the access token for authentication
6.If the access token is valid, the resource server (API) serves the resource to the application.
Application Registration
Before using OAuth with your application, you must register your application with the service. This is done through a registration form in the developer or API portion of the service’s website, where you will provide the following information (and probably details about your application):
1.Application Name
2.Application Website
3.Redirect URI or Callback URL
Comments
Post a Comment