Skip to content

OAuth2.0

Extract from Wikipedia's article:

OAuth is an open standard for access delegation, commonly used as a way for Internet users to grant websites or applications access to their information on other websites but without giving them the passwords. This mechanism is used by companies such as Google, Facebook, Microsoft and Twitter to permit the users to share information about their accounts with third party applications or websites.

We use version 2.0 of the specification.

Create an application

To communicate with braincube data, you must create an application on the relevant braincube.

Once you have logged in to https://mybraincube.com, you need to access the application configuration.

And then the applications tab.

Click the Add button at the top left and fill in both text fields:

  • Application name: the name of your application
  • Redirect URL: the callback URL of your application (must be in https)

Once you have verified your entry, you will find the summary of your application by clicking on it in the table. Make note of the following information to configure your OAuth2.0 client:

  • Client ID
  • Client Secret

Flow

To sum up:

  • Get an OAuth2.0 access token via one of our clients or any Oauth2 compatible client.
  • Get a Braincube SSO token by opening a session using the OAuth2.0 access token
  • Query the Braincube API thanks to the SSO token

Clients

Open a SSO session

You must run a GET HTTP request at https://mybraincube.com/sso-server/ws/oauth2/session which will contains the following header (where the value of the Bearer is the OAuth2.0 access token):

  • Authorization: Bearer ${your_oauth2_access_token}

Example:

curl -i https://mybraincube.com/sso-server/ws/oauth2/session -H "Authorization: Bearer ${your_oauth2_access_token}"