Configuring authentication for a Node.js server

You can configure authentication for a Node.js server.

About this task

The configuration file config.json has an entry named Auth-Profiles, which is a set of unique profile names and corresponding authentication properties. The properties must contain a type property, which identifies one of the supported authentication mechanisms. Currently, LDAP and BASIC (case-sensitive) are supported. In BASIC authentication profile, only an IBM® Engineering Workflow Management (EWM) server that is configured for BASIC or FORM authentication is supported as the authentication endpoint.

You can define multiple authentication profiles (multiple LDAP profiles and/or multiple BASIC profiles), and associate a particular profile with a Git URL prefix, by setting the authProfile property. The value of this property must be one of the authentication defined profile names; otherwise, no authentication is performed.

Procedure

  1. To configure LDAP authentication:
    1. Shut down the server, if required. For more information, see Shutting down a Node.js server.
    2. Open the config.json file.
    3. Edit the sample LDAP authentication profile with values pertaining to your LDAP server. Basic properties are already listed in the file. However, you can add others properties. The list of properties is described here: https://github.com/vesse/node-ldapauth-fork#ldapauth-configoptions.
    4. Associate the profile name with the Git URL prefix by setting the configuration property Git-URL-Prefixes.
    5. Save the config.json file and restart the server.

    Example

    "Auth-Profiles" :
    {
       "Ldap-1" :
       {
         "type" : "LDAP",
         "url" : "ldap://ldap-server:389",
         "bindDn" : null,
         "bindCredentials" : null,
         "searchBase" : "ou=people,dc=test,dc=lan",
         "searchFilter" : "(uid={{username}})",
         "searchAttributes" : null
       }
    },
    "Git-URL-Prefixes" :
    {
       "/git" :
       {
         "authProfile" : "Ldap-1"
       }
    }

  2. To use an EWM server configured for HTTP Basic or FORM authentication:
    1. Shut down the server, if required. For more information, see Shutting down a Node.js server.
    2. Open the config.json file.
    3. Edit the sample HTTP Basic authentication profile. Replace https://<hostname>:<port>/<context-root-for-ccm> with the values specific to your environment. For example: https://rtcserver:9443/ccm.
    4. Associate this profile name with the Git URL prefix by setting the configuration property Git-URL-Prefixes.
    5. If the EWM server is configured for Basic authentication, save the config.json file.
    6. If the EWM server is configured for FORM authentication, perform the following additional steps:
      1. Locate the property Git-Use-Request.
      2. Change the value from false to true.
      3. Save the config.json file.
      4. From the command line, navigate to the rtc-git-server-toolkit/server directory and run npm install --production.
    7. Restart the EWM server.

    Example

    "Auth-Profiles" :
    {
       "Basic-1" :
       {
         "type" : "BASIC",
         "url" : "https://rtc-server:9443/ccm/secure/authenticated/identity",
         "method" : "GET"
       }
    },
    "Git-URL-Prefixes" :
    {
       "/git" :
       {
         "authProfile" : "Basic-1"
       }
    }


video icon Video

Jazz.net channel
Software Education channel

learn icon Courses

IoT Academy
Skills Gateway

ask icon Community

Jazz.net
Jazz.net forums
Jazz.net library

support icon Support

IBM Support Community
Deployment wiki