Install Authenticate

Haventec Authenticate and Console requires a PostgreSQL database

See setting up a database for details.

Create configuration files

Each container requires a configuration file with a list of variables to specify the database details and the URI of the other container. Please edit it to match your environment.

Haventec Authenticate configuration file

Create the file env_haventec_authenticate.list . This is an example:


    #######################################
    # Haventec Authenticate env variables #
    #######################################
    # HTTPS Docker configuration
    #       on    : The container expects HTTPS requests, it uses a self-signed certificate
    #       off   : (default) The container expects HTTP requests
    #HTTP_SSL=on

    # Database properties (Note: The current Haventec Authenticate version only supports postgreSQL DB)
    DB_HOST=postgres
    DB_PORT=5432
    DB_NAME=htauthenticate
    DB_USER=haventec
    DB_PASS=password

    # Haventec Console API URI
    # Used to communicate to Haventec Console internally. (Authenticate sends requests to Console)
    HAVENTEC_CONSOLE_API_URI=http://console:9005/api

    # Haventec Authenticate URI
    # Public facing base URI of Haventec Authenticate (e.g: https://api.haventec.com)
    HAVENTEC_AUTHENTICATE_URI=http://authenticate:9000

    # Profile chosen to run the application Haventec Authenticate
    #       production_postgres      : Production profile with a PostgreSQL DB
    #       production_postgres_ssl  : Production profile with a PostgreSQL DB using TLS
    PROFILE=production_postgres

    # Java Virtual Machine Options
    #
    #JVM_OPTIONS=-Xms512m -Xmx512m -XX:NativeMemoryTracking=summary -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps -XX:+AlwaysPreTouch

    # NGINX Logs Options
    #      on      : NGINX logs to the standard docker output (Default)
    #      off     : Switch off NGINX logs
    NGINX_LOGS=off

    # Application Log Format (Optional)
    #      Not present  : Text line (Default)
    #      JSON         : JSON format
    #LOGS_FORMAT=JSON
    

Haventec Console configuration file

Create the file env_haventec_console.list . This is an example:


    ##################################
    # Haventec Console env variables #
    ##################################
    # HTTPS Docker configuration
    #       on    : The container expects HTTPS requests, it uses a self-signed certificate
    #       off   : (default) The container expects HTTP requests
    #HTTP_SSL=on

    # Database properties (Note: The current Haventec Console version only supports PostgreSQL DB)
    DB_HOST=postgres
    DB_PORT=5432
    DB_NAME=htconsole
    DB_USER=haventec
    DB_PASS=password

    # Haventec Console URI
    # Public facing root page of Haventec Console where users login (e.g: https://console-demo.haventec.com)
    HAVENTEC_CONSOLE_URI=http://console:9005

    # Haventec Authenticate URI
    # Used to communicate to Haventec Authenticate internally. (Console sends requests to Authenticate)
    HAVENTEC_AUTHENTICATE_URI=http://authenticate:9000

    # Profile chosen to run the application Haventec Authenticate
    #       production_postgres      : Production profile with a PostgreSQL DB
    #       production_postgres_ssl  : Production profile with a PostgreSQL DB using TLS
    PROFILE=production_postgres

    # Java Virtual Machine Options
    #
    #JVM_OPTIONS=-Xms512m -Xmx512m -XX:NativeMemoryTracking=summary -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps -XX:+AlwaysPreTouch

    # NGINX Logs Options
    #      on      : NGINX logs to the standard docker output (Default)
    #      off     : Switch off NGINX logs
    NGINX_LOGS=off

    # Application Log Format (Optional)
    #      Not present  : Text line (Default)
    #      JSON         : JSON format
    #LOGS_FORMAT=JSON

    # OpenID Connect Landing Page API URL (Optional)
    # It's required if you would like to use the OIDC LP service in your on-premise environment
    #HAVENTEC_LANDINGPAGE_URI=https://oidclp.auth.haventec.com
    

Download the Haventec Docker images

Log into Docker hub

Open a terminal and log into Docker Hub with the account credentials provided to you by Haventec.

If you cannot access the Haventec Docker repository, please contact us.


    docker login --username=yourusername
    

Load the Haventec Docker images


    docker pull haventec/authenticate:latest
    docker pull haventec/console:latest
    

For simplicity, this manual will run both containers on a single local server. The containers need to communicate to each other so we need to create a docker network to allow that communication.


    docker network create haventec-network
    

If you have the PostgreSQL DB also running locally in a docker, we have to add it to the docker network:


    docker network connect --alias postgres haventec-network postgres
    

Run Haventec Authenticate Docker

Execute the following command from the folder that contains the configuration file env_haventec_authenticate.list.


    docker run  --env-file env_haventec_authenticate.list \
        --name "haventec_authenticate"                    \
        -it -p9000:9000                                   \
        --net haventec-network                            \
        --net-alias "authenticate"                        \
        "haventec/authenticate:latest"
    

Test


    http://localhost:9000/authenticate/v1-2/health
    

You should see a health status like


    {
        "responseStatus": {
            "status": "SUCCESS",
            "message": "OK",
            "code": ""
        }
    }
    

You can access your local Authenticate Swagger documents at

http://localhost:9000/authenticate/v1-2/api-docs.html

Run Haventec Console Docker

Execute the following command from the folder that contains the configuration file env_haventec_console.list.


    docker run  --env-file env_haventec_console.list  \
        --name "haventec_console"                     \
        -it -p9005:9005                               \
        --net haventec-network                        \
        --net-alias "console"                         \
        "haventec/console:latest"
    

Test


    http://localhost:9005/
    

You should see a the Haventec Console login page

Test


    http://localhost:9005/api/cloud-portal/v1-2/health
    

You should see a health status like


    {
        "responseStatus": {
            "status": "SUCCESS",
            "message": "OK",
        "code": ""
        }
    }
    

Next steps

Setup Authenticate