OAuth 2.0 is an open standard for authorization that enables client applications to access server resources on behalf of a specific resource owner. OAuth also enables resource owners (end users) to authorize limited third-party access to their server resources without sharing their credentials. For example, a Gmail user could allow LinkedIn or Flickr to have access to their list of contacts without sharing their Gmail user name and password.
The API Gateway can be used as an authorization server and as a resource server. An authorization server issues tokens to client applications on behalf of a resource owner for use in authenticating subsequent API calls to the resource server. The resource server hosts the protected resources, and can accept or respond to protected resource requests using access tokens.
| Note | This guide assumes that you are familiar with the terms and concepts described in the OAuth 2.0 Authorization Framework. |
The API Gateway uses the following definitions of basic OAuth 2.0 terms:
userinfo/readonly.Assume that you are using a image printing website such as Canon to print some of your photos. You also have some photos on your Flickr account that you would like to print. However, you must download all these locally, and then upload them again to the printing website, which is inconvenient. You would like to be able to sign into Flickr from your Canon printing profile, and print your photos directly.
This problem can be solved using the example OAuth 2.0 web server flow shown in the following diagram:
Out of band, the Canon printing client application preregisters with Flickr and obtains a client ID and secret. The client application registers a callback URL to receive the authorization code from Flickr when you, as resource owner, allow Canon to access the photos from Flickr. The printing application has also requested access to an API named /flickr/photos, which has an OAuth scope of photos.
The steps in the diagram are described as follows:
| Note | You have not shared your Flickr user name and password with the printing application. At this point, you as resource owner are no longer involved in the process. |
API Gateway provides the following features to support OAuth 2.0:
The following diagram shows the roles of the API Gateway as an OAuth 2.0 resource server and authorization server:
For more details on the API Gateway OAuth 2.0 support, see the following topics:
For more details on the OAuth 2.0 specification, go to: