Create a first application
Secure your first application with LeZa
All applications secured with LeZa use the LeZa proxy as an access gateway. The proxy can be deployed on any cloud provider infrastructure or local server by the application/service owner (client). In order to configure the LeZa proxy, you must first register your application and get a Client ID and a Client Secret
In order to get your application registered. You will generate a client/application Id and client/application secret for the authentication layer. You need to follow these steps:
1) Click on the application tab from the left sidebar.
2) Click on plus icon (+) button to create a new application.
The application section
3) Complete the registration form
The application creation form
- 1.Add an application name - this is your application/service name.
- 2.Add a callback url - this is the URL where your application/service is hosted.
- 3.Click on the "Ok" button.
If you are going to run Leza Proxy locally then your callback is http://localhost/auth/callback otherwise http://[domian or ip]/auth/callback
Services are parts of your application or can be the whole application itself. In modern architectures we prefer to separate different units of logic in "micro-services" these micro-services are poorly coupled which makes development and maintenance easier.
For example, an application can have one front-end web application service and a back-end API.
In this case, we would register two services:
- 1.The front end web application
- 2.The back-end API
In order to register a service use the following steps:
1) Click on the services tab from the main menu.
2) Click on the plus icon (+) button on the top right of your main screen to create the new service.
3) Add a name for your service, this name will help you to identify your service on LeZa
4) Add a URL for your service
The URL of your service is the address of the service from a LeZa proxy point of view. So if LeZa proxy and your service are running on a private network (which we strongly recommend), then the URL should be the private IP of that service AND the port to reach the service via http or https.
If you install the application on your private machine then the URL of your service should be the following:
- http://[YOUR_PRIVATE_IP]:[PORT] for Linux
- http://[YOUR_NETWORK_IP]:[PORT] for MAC
5) Add a base path of your service, the base path is the pattern of your service path in the URL.
6) Add a service logo, in order to recognize it easily.
Select if your service is private or public, a public service can be accessed without being logged in (like a front-end for example in certain cases).
7) Click on the "Ok" button
Your service should now be created and be ready to use.
An end-point is a function accessible through your service. Each endpoint is determined by its path. Configuring endpoints will allow you to create custom rules to control access to those endpoints, we highly recommend you register all of your endpoints in order to get the most out of LeZa.
In order to start creating endpoints, you must click on an already created service (Go to the previous section to create a service). Then go on the endpoints section and click on the little plus (+) button.
1) Go to the endpoints tab
2) Click on add endpoint
Complete the following information:
1. Enter the name of your service endpoint, we recommend naming it according to its function for easy identification purposes
2. Enter the name of your resource. Recommendation: Depending on the information that the resource manages, you should name it accordingly (for example if the API returns oranges you should call it oranges)
3. Select the HTTP method type - (GET, POST, PUT, DELETE)
4. Enter the service path to reach the function
5. Click on "next" to finish the creation of the endpoint
After registering your services and creating their endpoints accordingly you will need to attach them with the corresponding application. To do this follow these steps:
- 1.Click on the "application tab" from the left sidebar.
- 2.Go to the details view by clicking on the "edit" action icon.
- 3.Click on the "services" tab.
- 4.Click on the "attach" toggle button to attach a service to the application.