Big5 oAuth2 Examples
Examples are based on Discord services. Discord is a popular messaging, media and social networking platform. Start with creating your own free account on discord https://discord.com
Example 1 – simplified. See below for more detailed example where you can generate your own values of the oAuth2 fields.
In this example we have done the preliminary work and all that left for you is to plug-in the information below in your Big5 HTTP Profile and create and run the HS4 event to see the result.
Here is the information you need to plug-in in your Big5 HTTP profile
Client ID: 850032070776193034
Client secret: 62AIjy35-UdpbNAsKxtHqkHgHAX7MiRZ
Scopes: identify email
Authorize URL: https://discord.com/api/oauth2/authorize
Token URL: https://discord.com/api/oauth2/token
Redirect URL: http://192.168.1.248/Big5HS4/oauth2_callback.html
Device name expression: “email”
Device value expression: JSON(input,”email”)
Press the button “REQUEST AUTHORIZATION” and a Discord web page should open allowing you to log-in with your Discord credentials and issue authorization for Big5 to access your private data, which for this example is your e-mail address.
Now that you are authorized to retrieve data from Discord let’s create HS4 event to get the data in HS4
Create HS4 event and choose Big5HS4 HTTP action.
Select your Discord profile as a target of your action.
The content of the message should be this.
Run your event and Big5 will create a device for you in HS4 with name “email” and string “your e-mail address”
Example2 – detailed
In this example we will use Discord again, however we will show you how to obtain your own oAuth2 elements, that were provided ready made for you in Example 1.
Go to https://discord.com/developers/applications and select “New application” and give it any name (not Big5 please as it is taken). Click on your new application and look in the left pane of the new window that Discord will open for you. Select oAuth2 from this left pane. Now you see the information about your own
Copy them both and enter into your Big5 HTTP profile ( oAuth2 section)
While at Big5 HTTP profile (oAuth2 section) please copy the Redirect URL that should be preconfigured automatically by Big5 to http://xxxxxxxxxxx/Big5HS4/oauth2_callback.html If it is not pre-configured than set it at this address replacing xxxxxxxxx with your own IP address of your HS4 machine
Please copy the Redirect URL from the HTTP Big5 oAuth2 profile to the provided space at Discord page with your app’s oAuth2 info
In order to fill the box “scopes” in Big5 HTTP oAuth2 profile you need to select the scopes from the available scopes provided by Discord here
Separate the scopes by a space. We recommend using this for beginners
but you can play with other available scopes as well. Please note that they are case sensitive.
Press “REQUEST AUTHORISATION” button in your Big5 HTTP oAuth2 profile and provide the requested authorization at the Discord page that pops up. Proceed further as in Example 1.