Why do it?

LuciadLightspeed includes an OGC Web Client Suite API, which allows you to connect your LuciadLightspeed-based application with OGC web services. In practice, such web services are frequently access-restricted: they require authentication through a user name and a password before they grant access.

How to do it?

In this article, we focus on HTTP Basic Authentication, a simple but common authentication approach for HTTP-based communication. Within this approach, a service informs the client of an authentication requirement through an HTTP response code. The client then supplies the required credentials through an HTTP header encoded with Base64.

If you are using Lucy as your OGC client, it will automatically show a login panel when an OGC service requires credentials.

If you are working directly with the LuciadLightspeed API, you have to supply credentials as follows:

  1. Create a TLcdOWSHttpTransport instance and supply the credentials through the constructor. The class TLcdOWSHttpTransport is used by the OGC Web Client Suite to handle the communication with a service.

  2. Use the TLcdOWSHttpTransport instance to create a model for the OGC web service. The type of OGC service determines how you can create the model: