Configure the Web API settings

To configure the Web API settings:

  1. Select the Web APIs tab in the PowerServer project painter.

  2. Select to create a new solution or select an existing solution from the Solution name list.

    New solution vs. existing solution

    Depending on whether multiple applications will use the same PowerServer solution or each application will use its own PowerServer solution, you can choose to create a new C# solution or an existing solution. If you want one PowerServer solution to be used by all applications, you can choose an existing solution; and then deploy the app (as well as the others) to this solution. If you re-deploy an app to an existing solution, the application data models and ESQLs will get updated in the solution, and if you deploy a new app to an existing solution, the application data models and ESQLs will be added to the existing solution.

    You can also select whether to overwrite the server settings (such as database configurations, license, Web API port etc.) in the existing solution. Apps deployed to the same solution can share settings such as the PowerServer license, Web API port, database configurations etc. and can take advantage of new developments added by the user such as authorization, file server etc.

    For more information about the PowerServer C# solution, see About the PowerServer C# solution.

  3. Select a template type from the Auth Template list.

    • Do not use auth service: Provides no authentication template.

    • Use built-in JWT server: Includes a built-in authentication server that supports JWT or bearer tokens. See Tutorial 6: Authenticating your apps > Using JWT for more information.

    • Use built-in OAuth server: Includes a built-in authentication server based on IdentityServer4 framework that works with the OAuth 2.0 authorization flows. See Tutorial 6: Authenticating your apps > Using OAuth 2.0 for more information.

    • Use built-in AWS Cognito server: Includes a built-in authentication server that works with the Amazon Cognito user pool. See Tutorial 6: Authenticating your apps > Using Amazon Cognito for more information.

    • Use external auth service: Includes templates that can be easily extended to support the other identity providers that work with the OAuth flows or JWT, such as Azure AD or Azure AD B2C. See Tutorial 6: Authenticating your apps > Using other auth servers for more information.

  4. Input a name as the namespace for the PowerServer C# solution.

    The namespace can only contain characters, numbers, and underscores, and the first character must be a capital letter or underscore.

  5. Specify the Web API URL.

    It is highly recommended that you specify an HTTPS URL for the production environment.

    This URL will be stored in two areas:

    • The complete Web API URL will be stored on the Web server, so that the client knows where to call the PowerServer Web APIs. You can change the value of the Web API URL on the Web server using a command-line tool (CustomizeDeploy.dll). See this section for more details.

    • The port number in the Web API URL will be also stored in the PowerServer C# solution; so that when the PowerServer Web APIs starts in the development environment, it starts at this port number. You can change this port number in the PowerServer C# solution > ServerAPIs project > Properties > launchSettings.json > "applicationUrl" setting.