How to configure basic authentication from z/OS

Configure basic authentication from z/OS Address Space to an IBM® z/OS Connect Server.

zosConnect-3.0 Applies to zosConnect-3.0.

This task is applicable when z/OS Connect is used as an API requester.

About this task

To use basic authentication to authenticate your z/OS application, pass the user's credentials from the z/OS application to the z/OS Connect Server by using parameters on the Host API BAQINIT call from the z/OS application.

To send the user credentials from the z/OS application to the z/OS Connect Server as parameters on the Host API BAQINIT call use the BAQ-ZCON-PARAMETERS structure in the supplied BAQHAREC COBOL copybook. For each parameter to be passed, create an instance of the BAQ-ZCON-PARMS structure and set the BAQ-ZCON-PARM-NAME, BAQ-ZCON-PARM-ADDRESS and BAQ-ZCON-PARM-LENGTH values. For example,

       WORKING-STORAGE SECTION. 
      * API requester Host API required copybooks
       COPY BAQHAREC.
       COPY BAQHCONC.
     ...
      * User credentials for basic authentication
       01 MY-USER PIC X(10) VALUE 'myusername'. 
       01 MY-PSWD PIC X(10) VALUE 'mypassword'.
       PROCEDURE DIVISION.
     ...
      * Set user credentials
           MOVE BAQZ-SERVER-USERNAME 
             TO BAQ-ZCON-PARM-NAME OF BAQ-ZCON-PARMS(1) 
           SET BAQ-ZCON-PARM-ADDRESS OF BAQ-ZCON-PARMS(1) 
             TO ADDRESS OF MY-USER 
           MOVE LENGTH OF MY-USER 
             TO BAQ-ZCON-PARM-LENGTH OF BAQ-ZCON-PARMS(1) 
           MOVE BAQZ-SERVER-PASSWORD 
             TO BAQ-ZCON-PARM-NAME OF BAQ-ZCON-PARMS(2) 
           SET BAQ-ZCON-PARM-ADDRESS OF BAQ-ZCON-PARMS(2) 
             TO ADDRESS OF MY-PSWD 
           MOVE LENGTH OF MY-PSWD 
             TO BAQ-ZCON-PARM-LENGTH OF BAQ-ZCON-PARMS(2). 
      * Make the BAQINIT call
...