Tutorial 1: First OAuth Authentication towards myBuildings cloud

In this short tutorial, a successful connection to an ABB myBuildings account via cloud should be established. Therefore, an access token and a refresh token should be obtained via SSO (Authorization Code).

Preconditions:

* You have created a myBuildings account

* You request the activation of your myBuilding account as developer account with us.

* Redirect URL is set to OAuth Helper (by default)

* You install the Postman software or use it in the Web version (https://www.getpostman.com/)

* Download the current Postman collection for the free@home API from the ABB Developer Portal and import it into Postman

Step 1

With the help of Postman, the OAuth2.0 process can run automatically for the first attempts. To do this, follow the steps as described in the image below.

Token Name: can be assigned individually and serves the purpose of recognition

Grant Type: Authorization Code

CallBack URL: The URL to the OAuthHelper that was provided to you personally

Auth URL: https://eu.mybuildings.abb.com/sso/authorize

Access Token URL: https://eu.mybuildings.abb.com/sso/token

Client ID: your personal client ID

Client Secret: Your personal client secret

Scope: RemoteControl Monitoring RegisterDevice

RemoteControl complies with the right that your application may remotely control

Monitoring complies with the right that your application (only) receives statis from the system but is not allowed to tax

RegisterDevice defends the right that your application may also create (virtual devices)

Enter the three possible entries according to the desired rights in the Scope field. They are entered separated by spaces



Step 2

Press the button "Request Token"

Step 3

In the now open SSO window of ABB myBuildings, please enter your myBuildings Portal credentials or any myBuildings Account you have the access to.

Step 4

If successful, see the successfully received access token and refresh token.

Step 5

As soon as you press the "Use Token" button, the Access Token is automatically taken over as for all calls in that Postman collection.

Step 6

Done! You are successfully connected to the ABB myBuildings cloud environment and can start over to the next steps. Therefore see our next tutorials.


Please be aware that this tutorial only shows to receive the access and refresh token manually. This does not include to automatically request a new access token via refresh token before the access token gets obsolete (3600sec).