Standards, best practices and how-tos for developing OutSystems applications
This page is under construction
See Add Custom Authentication to an Exposed REST API
In this how-to we’ll demonstrate the following custom authentication methods:
When using api key for authentication you need a method to associate api-keys with a consumer user. For this you can create a api key management solution.
To keep the example simple we use site properties to store the api key and the associated user.
It is recommended that you create your own api key management solution based on your business needs. This can be a token per Customer, or per user with an API Key self service. Like the one’s OutSystems is providing for their API’s. E.g. AI Mentor Studio API authentication
APIKey <> "" and APIKey=Site.APIKey
User.Username = Site.APIServiceAccountUserName
GetUserByUsername.List.Empty
Your action flow should now look like this
Set the API authentication property to custom. This adds an OnAuthentication callback action.
Add the following depencies:
In the OnAuthentication flow add the following actions:
Your action flow should now look likt this: