Si estoy utilizando la 5R3 y como bien dices el chgusrprf sole me vale para la  parte del 400.

http://publib.boulder.ibm.com/infocenter/iseries/v5r3/index.jsp?topic=/apis/sec.htm

en este link estan las apis de seguridad.

en el apartado:
        Enterprise Identity Mapping (EIM) APIs
y dentro la api:
        Add EIM Association (eimAddAssociation)

con el codigo:

#include <eim.h>
#include <stdio.h>

int main(int argc, char *argv[])
{
   int           rc;
   char          eimerr[100];
   EimRC       * err;
   EimHandle   * handle;

   EimIdentifierInfo x;

   /* Get eim handle from input arg.           */
   /* This handle is already connected to EIM. */
   handle = (EimHandle *)argv[1];

   /* Set up error structure.                  */
   memset(eimerr,0x00,100);
   err = (EimRC *)eimerr;
   err->memoryProvidedByCaller = 100;

   /* Set up identifier information            */
   x.idtype = EIM_UNIQUE_NAME;
   x.id.uniqueName = "mjones";
   
   /* Add an admin association                 */
   if (0 != (rc = eimAddAssociation(handle,
                                    EIM_ADMIN,
                                    &x,
                                    "MyRegistry",
                                    "maryjones",
                                    err)))
   {
       printf("Add Association error = %d", rc);
       return -1;
   }
   /* Add a source association                 */
   if (0 != (rc = eimAddAssociation(handle,
                                    EIM_SOURCE,
                                    &x,
                                    "kerberosRegistry",
                                    "mjjones",
                                    err)))
   {
       printf("Add Association error = %d", rc);
       return -1;
   }
   /* Add a target association                 */
   if (0 != (rc = eimAddAssociation(handle,
                                    EIM_TARGET,
                                    &x,
                                    "MyRegistry",
                                    "maryjo",
                                    err)))
   {
       printf("Add Association error = %d", rc);
       return -1;
   }

   return 0;
}

Lo que parece que no se conseguir es el Handle, aunque he conseguido encontrar esta otra api;
(eimCreateHandle) , que parece que lo genera, tampoco se como llamarlas entre ellasy como pasar por parametros los datos de usuario registoseim etc. Imagino que cualquiera con unos minimos conocimientos de C lo montara en un tris, pero yo me veo inutil.

#include <eim.h>
#include <stdio.h>

int main(int argc, char *argv[])
{
   int           rc;
   char          eimerr[100];
   EimRC       * err;
   EimHandle     handle;
   EimHandle     handle2;
   char * ldapURL = "ldap://eimsystem:389/ibm-eimDomainName=myEimDomain,o=mycompany,c=us";

   /* Set up error structure.                 */
   memset(eimerr,0x00,100);
   err = (EimRC *)eimerr;
   err->memoryProvidedByCaller = 100;

   
   /* Create a new eim handle. Use the eim configuration URL */
   if (0 != (rc = eimCreateHandle(&handle,
                                  NULL,
                                  err)))
       printf("Create handle error = %d", rc);
   
   /* Create a new eim handle. Use the specified URL */
   if (0 != (rc = eimCreateHandle(&handle2,
                                  ldapURL,
                                  err)))
       printf("Create handle error = %d", rc);

   return 0;
}



Pedro Pinedo Hernandez:  Analista-Programador
Grupo Amcor Flexibles Hispania S.L.  
Planta: Tobepal Logroño
Departamento de Informática / IT Department
tfno.:+34 941 28 60 90 - 941 03 01 39
fax: +34 941 20 75 43
26006 Logroño Spain
[EMAIL PROTECTED]
(quitar nospam del dominio, para enviar)


[EMAIL PROTECTED] wrote on 09/03/2006 17:21:35:

> Si usas V5R3 para la asociacion destino puedes utilizar un
>
> CHGUSRPRF USRPRF(AJUT400)
>           EIMASSOC(*USRPRF *TARGET *REPLACE *CRTEIMID)
>
> El Single Sign On en "muy bonito para el usuario" pero es una tarea
> añadida para quien deba mantenerlo.
>
> Si no te importa me puedes decir donde has visto el ejemplo en C....
> por si se me ocurre una forma de adaptarlo a ILE-RPG
>
> Salu2
>
> El 9/03/06, Pedro Pinedo<[EMAIL PROTECTED]> escribió:
> >
> > Estoy configurando el iseries para que admita la autentificacion kerberos. Y
> > lo he conseguido.
> >
> > Mi problema son las asociaciones de usuarios, desde el iseries navigator,
> > ningun problema, ahora bien, tengo un numero grande de usuarios y queisiera
> > automatizarlo. He visto las apis para esto (eimAddAssociation, y demas) pero
> > me pierdo por que los ejemplos estan en "C", ¿alguien lo tenga ya
> > implementado y me puede ayudar? quisiera un programa que pasandole el
> > usuario (u otros necesarios), me creara las asociaciones destino y origen.
> >
> > Gracias.
> >
> > Pedro Pinedo Hernandez:  Analista-Programador
> >  Grupo Amcor Flexibles Hispania S.L.
> >  Planta: Tobepal Logroño
> >  Departamento de Informática / IT Department
> >  tfno.:+34 941 28 60 90 - 941 03 01 39
> >  fax: +34 941 20 75 43
> >  26006 Logroño Spain
> >  [EMAIL PROTECTED]
> >  (quitar nospam del dominio, para enviar)
> >  _______________________________________________ AMCOR
> > FLEXIBLES - LEADING THROUGH INNOVATION
> > _______________________________________________ CAUTION -
> > This message may contain privileged and confidential information intended
> > only for the use of the addressee named above. If you are not the intended
> > recipient of this message you are hereby notified that any use,
> > dissemination, distribution or reproduction of this message is prohibited.
> > If you have received this message in error please notify AMCOR FLEXIBLES
> > immediately. Any views expressed in this message are those of the individual
> > sender and may not necessarily reflect the views of AMCOR FLEXIBLES.
>
>
> --
> Mi blog sobre as400
> http://www.ajut400.com
>
> __________________________________________________
> Forum.HELP400 es un servicio más de NEWS/400.
> © Publicaciones Help400, S.L. - Todos los derechos reservados
> http://www.help400.es
> _____________________________________________________
>
> Para darte de baja visita la siguente URL:
> http://coyote.combios.es/mailman/listinfo/forum.help400

Responder a