Create a file in your API Portal repository to define custom roles and their access
rights.
Before you begin
You have generated an API Portal repository from Talend Cloud API Designer. For more information,
see Publishing an API Portal.
Procedure
At the root of your API Portal repository, create a file named
staticwebapp.config.json.
This file defines routes and the user roles allowed to access them. For more
information, see Routes in Azure Static Web
Apps.
Define your routes.
In this example, you need to add five routes:
/login to allow users to log in with Azure Active
Directory.
/logout to allow users to log out.
/me to display information about the user.
/apis/* to specify how to handle the list of APIs and
the API documentation.
/getting-started to specify how to handle the "Getting
started" page.
/* to specify how to handle any other page on the API
Portal. This route should be the last one in the file.
If needed, you can also use routes to block other authorization
providers. For more information, see Block an authorization
provider.
Define a redirection in case users are not logged in.
Azure Static Web Apps returns a status code 401 when a user
who is not logged in tries to access a page available only to authenticated
users. You can redirect users from the default error page to a login page
using the responseOverrides element. For more information,
see Response overrides.
In this example, the staticwebapp.config.json file looks
like
this: