Example Entitlement Request and Response
When a client attempts to connect to your application, it sends an HTTP request to your entitlement service. In the request, the client transmits an application identifier and a set of user credentials. Your entitlement service attempts to authenticate the user credentials and to authorize those credentials for the application. If the credentials are successfully authorized, your entitlement service returns a response indicating success that contains the entitlement URL that the client will use to connect to the application.
If authorization is not successful, your entitlement service returns a response that should include some indication of the reason authorization was not granted. Clients should include logic to gracefully handle failed authorizations.
Example Request from the Client
The following shows an example of the HTTP headers and JSON body of a request sent from the client to an entitlement service. It includes user credentials and an application ID.
POST /api/entitlements/5565ba3a-7e75-4bce-baad-436843ad209e HTTP/1.1 User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8y zlib/1.2.5 Host: localhost:8080 Accept: */* Authorization:Username myUserId Content-Length: 0 Content-Type: application/x-www-form-urlencoded
Example Response from the Entitlement Service
The following shows an example of the HTTP headers and JSON body of a response sent from the entitlement service to a client. This illustrates an successful client authorization and returns an entitlement URL.
HTTP/1.1 201 Created Content-Type: text/plain Date: Fri, 01 Nov 2013 19:23:43 GMT Content-Length: 97 Server: Jetty(9.0.6.v20130930) https://appstream.us-east-1.amazonaws.com/entitlements/e018add2-242e-4396-8e47-ca5cd1a6060b