How to change the authentication type on your web application?
To change an authentication type you currantly use, see the steps below for each one:
Horusec Native
To use it, follow the steps:
- Add the environment variable HORUSEC_AUTH_TYPE = "horusec"in the horusec-auth microservice and you will enable the native authentication;
This authentication will be added in all microservices - “horusec-auth, horusec-account, horusec-api, horusec- analytic ”the environment variable HORUSEC_JWT_SECRET_KEY=”horusec-secret” ”- its value can be any and preferably a strong hash.
The value can be anyone of your choice, but it is necessary to have a strong hash.
LDAP
To configure this authentication, follow the steps:
- 
Add the environment variable HORUSEC_AUTH_TYPE=”ldap”in the horusec-auth microservice to define the authentication via LDAP;
- 
Add some environment variables in the microservice horusec-auth to make the connection with the tool, they are: 
| Environment variable name | Standard value | Description | 
|---|---|---|
| HORUSEC_LDAP_BASE | dc=example,dc=org | LDAP connection base | 
| HORUSEC_LDAP_HOST | 127.0.0.1 | LDAP connection host | 
| HORUSEC_LDAP_PORT | 389 | LDAP connection port | 
| HORUSEC_LDAP_USESSL | false | Checks whether to use SSL | 
| HORUSEC_LDAP_SKIP_TLS | true | Checks whether to skip TLS | 
| HORUSEC_LDAP_INSECURE_ SKIP_VERIFY | true | Checks whether to skip insecurity check | 
| HORUSEC_LDAP_BINDDN | cn=admin,dc=example,dc=org | Definition for Idap admin entity | 
| HORUSEC_LDAP_BINDPASSWORD | admin | Definition the LDAP admin entity password | 
| HORUSEC_LDAP_USERFILTER | (uid=%s) | What is the way of filter for users | 
| HORUSEC_LDAP_GROUPFILTER | (memberUid=%s) | What is the way of filter for groups | 
| HORUSEC_LDAP_ADMIN_GROUP | admin | What is the group administrators name | 
Keycloak
To configure this authentication, follow the steps:
- 
Add the environment variable HORUSEC_AUTH_TYPE=”keycloak”in the horusec-auth microservice that you will use in the authentication via Keycloak;
- 
In the horusec-auth microservice, add the connection variables with the keycloak, which are: 
| Environment variable name | Standard value | Description | 
|---|---|---|
| HORUSEC_KEYCLOAK_BASE_PATH | What is the keycloak connection base. Example:http://127.0.0.1:8080 | |
| HORUSEC_KEYCLOAK_CLIENT_ID | What is the client_id that you use. Example: account. | |
| HORUSEC_KEYCLOAK_CLIENT_SECRET | What is secret used to client_id. Example:00000000-0000-0000-0000-000000000000. | |
| HORUSEC_KEYCLOAK_REALM | What is the realm used. Example: master. | |
| HORUSEC_KEYCLOAK_OTP | false | If you are using otp (one-time password). | 
Then, to connect correctly, the horusec-manager will also need some environment variables:
| Environment variable name | Standard value | Description | 
|---|---|---|
| REACT_APP_KEYCLOAK_BASE_PATH | What is the Keycloak connection base Example: http://127.0.0.1:8080 | |
| REACT_APP_KEYCLOAK_CLIENT_ID | What is the client_id that you use. Example: account | |
| REACT_APP_KEYCLOAK_REALM | What is the realm used. Example: master | 
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.