Step 1: Add the INI file CloudSetting.ini to the Files preloaded in uncompressed format section in the Application page.
Step 2: Select RESTClient Support under the Runtime files group in the Application page > Advanced tab.
Step 3: Select Use built-in AWS Cognito server in the Security page.
Select Use built-in AWS Cognito server from the Auth Template list box, view the license terms, and select the "I have read and agree to the license..." option.
Step 4: Save the changes and then deploy the PowerServer project again (using the "Build & Deploy Project" option).
The PowerServer C# solution > UserExtensions project contains a built-in Amazon Cognito server and the authentication class files as shown below.
-
The built-in Amazon Cognito server authenticates the user credential with the Cognito service and returns an identity token. The built-in server runs automatically when the PowerServer Web APIs (the ServerAPIs project) runs.
-
The authentication class and configuration files will be used by the PowerServer Web APIs to validate the token passed from the client; and if validation is successful, data will be obtained from the database.
-
Authentication.json contains the settings for enabling the authentication feature ("PowerServer:EnableAuthentication") and specifying the Amazon Cognito user pool ("AWS").
The "PowerServer:EnableAuthentication" setting is set to true by default. Setting it to false will turn off the authentication feature.
The "AWS" block is used to specify the Amazon Cognito user pool including region, user pool ID, user pool client ID, and user pool client secret. See the next section for more details.
-