Specify the token URL

The token URL is where you can get a token.

Instead of hard-coding the token URL in the application scripts, we will specify the token URL in an INI file, so that the URL can be modified without affecting the scripts.

Step 1: Create an INI file in the same location as the PBT file and name it CloudSetting.ini.

Step 2: Specify the URL for requesting the token from the JWT server in the INI file.

In this example, TokenURL points to the "/connect/token" API of the built-in JWT server, and the JWT server root URL is the same as the root URL of PowerServer Web APIs (for example, http://localhost:5099/). If you change the PowerServer Web APIs URL, change the URL here accordingly.

[Setup]
TokenURL=http://localhost:5099/connect/token

The built-in JWT server has the same root URL as PowerServer Web APIs, therefore you can also use the GetPowerServerURL method to get and use the root URL, instead of specifying the URL in the INI file.

Likewise, you can also specify the login user name and password in the INI file, for testing purpose.

You will need to modify the application scripts to get the username and password from the INI file (instead of from the login window).

[users]
userName=alice
userPass=alice

Note

The INI file must be added as external file in the PowerServer project painter, in order to be deployed with the application. For more details, refer to the next section "Modifying and re-deploying the PowerServer project".