1.
Click the Login button. The Android application opens a URL to start a login session on The Things
Network server.
Note:
Example URL:
https://eu1.cloud.thethings.network/oauth/authorize?client_id=st25-lora-
provisioning&redirect_uri=https://www.myst25.com/lora/login/&state=
0FEF55D9FD8AE3F492EED15E4B498F71&response_type=code
For The Things Network URL for user authentication, refer to [6].
The following parameters are passed to this URL:
–
A client_id: (st25-lora-provisioning)
–
A redirect_uri: (https://www.myst25.com/lora/login/). This URI is called if the login, done in
the web browser, is successful.
–
A state value: This is a random value changed every time.
–
A response_type: Signifies to the authorization server that the application is initiating the
authorization code flow.
2.
Enter the login and password (with the login and password created for The Things Network user account).
3.
The browser communicates with The Things Network identity server to check the user identity.
4.
If the authentication is successful, the "redirect_uri" passed at step 1 is called. This URL starts with
https://www.myst25.com/lora/login/. If the authentication is not successful, an error message is displayed in
Chrome.
5.
A mechanism called Android App links (see [5]) is used: When the redirect_uri (starting with
www.myst25.com/lora/login) is called, the ST25 LoRa provisioning demo is automatically called. The
AppLink configuration is done in the manifest file of the Android application. A notification indicating a
successful login session is displayed when the Android application is viewed in the foreground. In the
parameter of the URL used, the application finds a JSON message containing an access_token. The
access_token is an ApiKey that is used to communicate with The Things Network server during this
session. It is used to authenticate the user and to grant the access to the features allowed to the user.
6.
The main screen of the LoRa
to The Things Network server to add or remove a LoRa
access_token as an API key.
UM3146 - Rev 1
Figure 10.
OAuth 2.0 authentication steps
®
application is launched. Once the user is authenticated, the user has access
®
Authentication in the Android application
device. It is done from HTTPS requests using the
UM3146
https://
page 10/33
Need help?
Do you have a question about the ST25DV64KC and is the answer not in the manual?
Questions and answers