Sending a Credentialed Cross-Origin HTTP Request
- Updated2024-05-31
- 3 minute(s) read
Sending a Credentialed Cross-Origin HTTP Request
Enable credentials in your WebVI, such as including and storing HTTP cookies, adding HTTP Authorization headers, or permitting TLS client certificates to interact with a web service.
In addition to configuring a web service to support cross-origin credentialed requests, configure the client handle to include credentials during a CORS requests.
What to Use
- Configure CORS
- Open HTTP Handle
- Close HTTP Handle
What to Do
Create the following diagram to send a credentialed cross-origin HTTP request.
Customize the gray sections for your unique programming goals.

|
|
Open HTTP Handle creates a client handle that preserves the headers you want to add to HTTP requests the application sends. |
|
|
Configure CORS adds configuration information, such as whether credentials should be included in CORS requests, to the client handle. |
|
|
Configure the HTTP node to access resources for your application. |
|
|
Close HTTP Handle closes the client handle and deletes any authentication credentials and HTTP headers associated with the handle. Note The browser cache independently stores and manages cookies a credentialed CORS request or same-origin request creates. Closing the client handle does not affect the cookies in the browser cache.
|
Troubleshooting
Some servers may require that your application not include credentials with a cross-origin HTTP request. If the server you send requests to responds with the Access-Control-Allow-Origin header set to *, the wildcard value, the HTTP request fails with a CORS configuration error. To resolve the error, set the include credentials during CORS input of Configure CORS to False. To enable credentialed access for a LabVIEW Web Service, see Configure a LabVIEW Web Service CORS for Credentialed Access.
Related Information
- Configuring CORS for a LabVIEW Web Service
You may need different CORS configurations for each LabVIEW Web Service in your application during development and deployment.
- Configure CORS
- Open HTTP Handle
- Close HTTP Handle
- Configure a LabVIEW Web Service CORS for Credentialed Access
Configure CORS to allow specific origins you define, well-known origins, and origins with credentials access to your WebVI resources.