> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# NetServer WebApi element

> NetServer WebApi element

Configuration values related to the [WebAPI][2] web services.

```XML theme={null}
<WebApi>
  <add key="AuthorizeWithUsername" value="true" />
  <add key="AuthorizeWithTicket" value="true" />
  <add key="AuthorizeWithImplicit" value="false" />
  <add key="CORSEnable" value="true" />
  <add key="CORSOrigin" value="http://foo.bar http://localhost/ http://localhost* https://mail.google.com" />
</WebApi>
```

| Name                  | Description                                                                                                                                                                                                                                                      | Default |
| --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| AuthorizeWithImplicit | Allow WebAPI to authorize with implicit identity from IIS.                                                                                                                                                                                                       | true    |
| AuthorizeWithTicket   | Allow WebAPI to authorize with session tickets.                                                                                                                                                                                                                  | true    |
| AuthorizeWithUsername | Allow WebAPI to authorize with username + password.                                                                                                                                                                                                              | true    |
| CORSEnable            | Allow 3rd party web pages to call WebAPI from the browser.                                                                                                                                                                                                       | true    |
| CORSOrigin            | If CORS is enabled, define space-delimited Origins that are allowed to call the WebAPI from the browser. Example value: `"http://foo.bar http://localhost/ http://localhost *"`. Default value enables our [SuperOfficeGmail link][9] to talk to the web client. |         |
| Documentation         | Turn on/off Swagger/OpenAPI documentation generation for WebAPI. Turn off to reduce memory usage.                                                                                                                                                                |         |

* **AuthorizeWithUsername** [enables username + password][4] (Basic) authentication. This method is not enabled in the Online environment.

* **AuthorizeWithTicket** enables SOTicket authentication.

* **AuthorizeWithImplicit** [enables authentication with IIS identity][3]. It means that your client has authenticated using Active Directory. This method is not enabled in the Online environment.

* **CORSEnable** turns on CORS headers, meaning that external sites must be listed in the CORSOrigin config to call the WebAPI. Default is on.

* **CORSOrigin** a list of space-separated URLs of sites that are allowed to call the WebAPI. If an external site tries to call, and it is not listed here, then the call will fail. You can use "\*" to allow all sites to call.

See the [NetServer Core reference][1] for details about handling this programmatically.

[1]: https://github.com/SuperOfficeDocs/superoffice-docs/blob/main/docs/en/api/reference/netserver/core/SuperOffice.Configuration.ConfigFile.WebApi.yml

[2]: ../reference/restful/index

[3]: ../../onsite/install/netserver/setup-rest#integrated-with-active-directory

[4]: ../../onsite/install/netserver/setup-rest#configure-basic-authentication-iis

[9]: https://online.superoffice.com/AppStore/superoffice-as/superoffice-gmail-link


## Related topics

- [NetServer Reporter element](/en/onsite/web-config/reporter.md)
- [NetServer Services element](/en/onsite/web-config/services.md)
- [NetServer Webhooks element](/en/onsite/web-config/webhooks.md)
- [NetServer Infrastructure element](/en/onsite/web-config/infrastructure.md)
- [NetServer Scripting element](/en/onsite/web-config/scripting.md)
- [NetServer Factory element](/en/onsite/web-config/factory.md)
