user_signon routine

Top  Previous  Next

When XCICS/TS auth_mode is set to "user", an user_signon routine must be declared.

This routine is invoked by XCICS/TS at operator SIGNON time (CESN and EXEC CICS SIGNON) to verify if an operator is authorized to use the requested USERID. The USERID must be declared in SNT.

Once XCICS/TS verified the the requested USERID has been defined, it calls the routine passing USERID and PASSWORD entered by the operator and the pointer to the SNT entry of the requested user.

The routine must return a valid return code to communicate to XCICS/TS whether the user is authorized or not.

Prototype

int function_name(char *userid, char *password, tCXsnt *snt_entry);

Passed parameters

name

type

description

userid

char *

a NULL terminated string, containing the USERID

password

char *

a NULL terminated string, containing the password

snt_entry

tCXsnt *

a pointer to the SNT entry of the user

Return codes

CXE_OK        user is authenticated
CXE_NOTAUTH   user is not authenticated

Example declaration

define exit_program type=user_signon, name=my_signon, library=libmysnt.so;

Example code

#ifdef _WINDOWS_SOURCE
#include "cics_snt.h"
#else
#include "cics.h"
#
 
int my_signon(char *userid, char *passwd, tCXsnt *snt_entry) {
 
if (strcmp(userid, "UI98736")==0 && strcmp(passwd, "SECRET")==0) {
   return CXE_OK;
}
 
if (strcmp(userid, "UI98556")==0 && strcmp(passwd, "PSW00011")==0) {
   return CXE_OK;
}
return CXE_NOTAUTH;
}