Skip to content

Latest commit

 

History

History
59 lines (40 loc) · 2.53 KB

File metadata and controls

59 lines (40 loc) · 2.53 KB

OAuth2

BugSplat supports authenticating via OAuth2 in addition to the username/password authentication described in our API docs. Currently, only the OAuth2 client credentials flow is supported. If you are interested in other OAuth2 authentication methods, please reach out to [email protected].

A reference client implementation can be found in our @bugsplat/js-api-client repo.

Client Credentials

To authenticate via OAuth2 client credentials you will need to create a Client Id and Client Secret pair on the OAuth Integrations page.

Adding a New Integration

Copy the Client Id and Client Secret to a secure location. Once you've dismissed the dialog the Client Secret will not be displayed again.

Authorize

The Client Id and Client Secret are used in a POST to the server and will return access_token and a token_type. The Authorize endpoint is described below.

Headers

Once an access_token and token_type have been acquired they can be used in any of the API requests outlined in our API docs. To make an authenticated request to one of BugSplat's API endpoints add a header with a key of Authorization and a value of ${token_type} ${access_token}.

{% swagger baseUrl="https://app.bugsplat.com" path="/oauth2/authorize" method="post" summary="Authorize" expanded="true" %} {% swagger-description %} Exchange a Client Id and Client Secret for a bearer token. {% endswagger-description %}

{% swagger-parameter in="body" name="scope" type="string" %} OAuth2 scope, currently only

restricted

is the only available scope {% endswagger-parameter %}

{% swagger-parameter in="body" name="client_secret" type="string" %} The Client Secret created above {% endswagger-parameter %}

{% swagger-parameter in="body" name="client_id" type="string" %} The Client Id created above {% endswagger-parameter %}

{% swagger-parameter in="body" name="grant_type" type="string" %} OAuth2 grant type, in this case,

client_credentials {% endswagger-parameter %}

{% swagger-response status="200" description="" %}

{
  "token_type": "Bearer",
  "expires_in": 3600,
  "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9[...]"
}

{% endswagger-response %} {% endswagger %}