Skip to end of metadata
Go to start of metadata

Sisense supports the OAuth2 protocol for signing REST requests.

OAuth2 is an open protocol, which allows secure API authorization in a simple and standard method from applications. When implementing OAuth 2, you must create a separate JSON file and include this in your connector's folder. In the Settings object, you provide the name of this file as the value of the key, OAuth2Config. 

 The general Oauth2 flow when retrieving data resources from RESTful services is as follows: 

  1. Sisense sends an authorization request to the resource provider. The provider then authorizes the request and Sisense requests an access token from the authorization server hosted by your data source. 
  2. The access token allows Sisense to retrieve data from the resource server for a limited time defined by the provider. 
  3. Sisense passes the access token to the resource provider and requests the data you want to import in the ElastiCube Manager.  

As a developer, you need to provide the URL and resource destinations in the oauthconfig file. 

There are three URLs, the first is the accesscodeservice where the data provider authorizes you to request an access token. 

The accesstoken service provides the access token needed to access the final server, the UserInfo or resource server where the data you want to import into Sisense is maintained. 

The remaining information you need to provide the is the clientID and the clientsecret. This information is provided by your particular data source. If you do not want to hardcode this data into your oauth config file, use the UI parameters object previously discussed to allow your users to dynamically enter their credentials. In this case, you need to comment out the ClientID and ClientSecret fields. 

The remaining details that need to be provided are the ClientTypeName, a redirect URL to redirect the user, and scope. 

Scope is defined by the data provider and limits what users can do to the data they handle from the data source provider such as read or write access. 

JSON Format

 

Name

Type

Mandatory

Comment

Provider

String

Yes

Provider system name. This value should be the same value as in main REST configuration file Settings section.

AccessCodeService

Object

Yes

Base URI and resource for REST call to get oath2 access_code.

AccessTokenService

Object

Yes

Base URI and resource for REST call to get oath2 access_token and refresh_token.

UserInfoService

Object

Yes

Base URI and resource for REST call to get user info.

ClientId

String

Yes

OAuth2 client ID.

ClientSecret

String

Yes

OAuth2 client secret.

RedirectUri

String

Yes

OAuth2 redirectUri where users will be sent back to after authorization. Sisense supports both HTTP and HTTPS.

Scope

String

Yes

Oauth2 scope. A URL-encoded, list of member permissions your application is requesting for a user space delimited. 

ClientTypeName

String

Yes

Name used internally to identify an oauth2 client.

 

Example

 

Oauth2
{
  "Provider": "rest-meetup",

  "AccessCodeService": {
    "BaseUri": "https://secure.meetup.com",
    "Resource": "/oauth2/authorize"
  },
  "AccessTokenService": {
    "BaseUri": "https://secure.meetup.com",
    "Resource": "/oauth2/access"
  },
  "UserInfoService": {
    "BaseUri": "https://secure.meetup.com",
    "Resource": "/2/member/self"
  },

  "ClientId": "ipv3255omrbfrossuqapqfl8ui",
  "ClientSecret" : "s8pi12goie2nqrrdnmvdrrm1tkb",
  "ClientTypeName": "sisense",
  "RedirectUri": "http://localhost:7077/auth/rest-meetup",
  "Scope" : "basic"
}


 
  • No labels