Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This chapter provides a general specification for OAuth Gateway type network services.  It contains these sections:·      

...

...

...

...

...

Service Overview

The OAuth Gateway type service is responsible for handling the redirect portion of the OAuth 2.0 protocol when the MediaBar needs to access systems that use that authentication mechanism.  This service can be address using the type "com.openmethods.ep.oauth.gateway".

...

Each registered service has information specific to its service type, vendor, or instance.  This information is available through the getServices Core Request or as part of the events produced by the Service Monitor Service.

Code Block
languagejson
{

...


  "vendor", "<vendor-name>",

...


  "version", "<current-version>"

...


}

Service Requests and Responses

...

The registerClient request is used by a client to initialize a new session on this gateway.  The session's unique identifier is included in the response so the client can easily bind to the session resource.  The client provides the contents of the oauth.settings block as-is in the data property.  These values are used by the gateway to interact with the environment's OAuth provider.

Request

{

Code Block
languagejson
{
  "command": "registerClient",

...


  "data":

...

{

                  <contains the environment object>

}


  {
    <contains the environment object>
  }
}

Success Response

Code Block
languagejson
{

...


  "command": "registerClient",

...


  "result": "success",

...


  "resource":

...

{


  {
    "id": "<resource-id>",

...


    "data":

...

<Contains the original data property of the request>

}


    {
      <Contains the original data property of the request>
    }
  }
}

Failure Response

Code Block
languagejson
{

...


  "command": "registerClient",

...


  "result": "failure",

...


  "failure":

...

{


  {
    "code": "<error-code-for-failure>",

...


    "message": "<error-message>",

...


    "context": "<stack-trace-if-applicable>"

...

}


  },
  "original":

...

<Contains the original registerClient request JSON structure>


  {
    <Contains the original registerClient request JSON structure>
  }
}

Secondary Events

This request should not generate any secondary service events.

...

Delivers the authorization token for this session.

Code Block

{

languagejson
{
  "access_token":"

...

<access_token>",
  "token_type":"bearer",

...


  "expires_in":

...

 <number_of_seconds>
}