Difference between revisions of "Using secured connections"

From i2Rest
Jump to: navigation, search
Line 21: Line 21:
 
     "gates":
 
     "gates":
 
     {
 
     {
       "main"      : {"url":"<span style="background:#00FFFF;">https</span>://<span style="color:red;"><host_name>[:port](for example api.i2rest.com:1234)</span>", <span style="background:#00FFFF;">"dcm_server_id":"<span style="color:red;">dcm_server_id</span>"</span>},
+
       "main"      : {"url":"<span style="background:#00FFFF;">https</span>://<span style="color:red;"><host_name>[:port](for example api.i2rest.com:1234)</span>", <span style="background:#00FFFF;">"dcm_server_id":"<span style="color:red;"><dcm server id></span>"</span>},
 
       "management" : {"url":"http://<span style="color:red;"><host_name>[:port] (for example api.i2rest.com:4321)</span>"}
 
       "management" : {"url":"http://<span style="color:red;"><host_name>[:port] (for example api.i2rest.com:4321)</span>"}
 
     },
 
     },
Line 33: Line 33:
 
                                     '-url' '${surl}'    \
 
                                     '-url' '${surl}'    \
 
                                     '-uid' '${uid}'    \
 
                                     '-uid' '${uid}'    \
                                     <span style="background:#00FFFF;>'-dcm_client_id' '<span style="color:red;">-dcm_client_id</span>'</span> \
+
                                     <span style="background:#00FFFF;>'<dcm client id>' '<span style="color:red;">-dcm_client_id</span>'</span> \
 
                                     '-user' '${user}')) \
 
                                     '-user' '${user}')) \
 
                             INLLIBL(I2REST)"
 
                             INLLIBL(I2REST)"

Revision as of 13:51, 29 June 2020

i2Rest Server uses standard IBM i GSK API to protect connections.

Step 1
Create text file named I2RESTECHO.PCML anywhere on IFS, for example "/tmp/PCML/i2restecho.pcml". Copy and paste following code. It represents a description for the sample program I2RESTECHO, that is included into i2Rest Server installation for demonstration purposes:
<pcml version="1.0">

   <program name="echo" path="/QSYS.LIB/%LIBL%.LIB/I2RESTECHO.PGM">
      <data name="echo" usage="inputoutput" type="char" length="10" trim="both"/>
   </program>

</pcml>
Step 2
Following instractions create Server Application, it will be used to supply secured connections to i2Rest gates.
Step 3
Following instractions create Client Application, it will be used to submit sessions, that use secured connections with session gate.
Step 4
Contact your system administrator for your IBM i server host name (or IP) and two available ports for "main" and "management" gates of your first i2Rest Server instance. Create file config.json (you can name it with any name and put it into any available IFS folder). Enter following text, replace host_name, ports and pcml_file with appropriate values.

Basic configuration SSL secured variant (differences are highlighted in blue):

{
   "gates":
   {
      "main"       : {"url":"https://<host_name>[:port](for example api.i2rest.com:1234)", "dcm_server_id":"<dcm server id>"},
      "management" : {"url":"http://<host_name>[:port] (for example api.i2rest.com:4321)"}
   },
   "session_systems":
   [
      {  "name"   : "*ANONYMOUS", 
         "submit" : "SBMJOB JOB(I2RESTA)                \
                            USER(${user})               \
                            CMD(CALL I2REST             \
                               PARM('-session'          \
                                    '-url' '${surl}'    \
                                    '-uid' '${uid}'     \
                                    '<dcm client id>' '-dcm_client_id' \
                                    '-user' '${user}')) \
                            INLLIBL(I2REST)"
      }
   ],
   "pcmls":
   [
      {
         "pcml_mount"         : "echo",
         "pcml_file"          : "<complete name of i2restecho.pcml on IFS (for example /tmp/PCML/i2restecho.pcml)>", 
         "valid_in_anonymous" : true
      }
   ]
}