GeneXus Access Manager
Agosto 2017
Aplicaciones Web
• N puntos de acceso
• Aplicaciones Web con Smooth UX y seguridad
Aplicaciones Smart Devices
¿Qué es GAM y qué resuelve?
• GeneXus Access Manager
• Biblioteca integrada en GeneXus
• Solución automática de seguridad para WEB y SD
• Autenticación
• Autorización
• Manejo de politicas de seguridad, contraseñas, permisos, roles,
etc.
Cómo activar el GAM?
• Enable Integrated Security = TRUE
• Integrated security Level
• None
• Authentication
• Authorization
• GAM Adminstrator user
¿Qué ocurre cuando se habilita el GAM?
Import de:
• Objetos externos para acceso a la API del GAM
• Backend de administración (Ejemplos de uso de la API)
• Frontend: Objetos de Login y Acceso Denegado
• Datastore del GAM
• Metadata : usuario de administración
Autenticación
• Integrated Security Level = Authentication
• Chequeo de seguridad automático en puntos no accesibles por
código
Autenticación
• Validación automática de la sesión
• Redireccionamiento automático al login
• Redireccionamiento automático al objeto que se quería ejecutar
Usuario anónimo en SD
• Identificar al usuario por el DeviceId
• Recuperar los datos cuando el usuario se registra
– Auto-Register Anonymous User Property
LOCAL
Autorización
• Integrated Security Level = Authorization
• Generación de Permisos automáticos de ejecución por cada
objeto
– <prefix>_Execute
– <prefix>_services_Execute
• Permisos sobre los modos de transacciones
– <prefix>_FullControl
– <prefix>_Execute
<prefix>_Insert
<prefix>_Update
<prefix>_Delete
Autorización
• Permisos sobre los modos de los servicios Rest (Business
Components)
– <prefix>_Services_FullControl
– <prefix>_Services_Execute
<prefix>_Services_Insert
<prefix>_Services_Update
<prefix>_Services_Delete
Permisos sobre Business Component Rest
Permisos sobre WWSD
GAM API
GAM API
&Role.Name= &Name
&Role.Description = &Dsc
&Role.ExternalId= &ExtId
&Role.SecurityPolicyId = &SecPolId
&Role.Save()
If &Role.Success()
Commit
Else
&Errors = &Role.GetErrors()
For &Error in &Errors
Msg(Format(!"%1 (GAM%2)", &Error.Message, &Error.Code))
EndFor
Endif
GAM API
&GAMPermission.GUID = &PermissionGUID
&GAMPermission.ApplicationId = &ApplicationId
&GAMPermission.Type = GAMPermissionAccessType.Allow
&IsOK = &User.AddPermission(&GAMPermission, &Errors)
if &IsOK
commit
else
For &Error in &Errors
Msg(Format(!"%1 (GAM%2)", &Error.Message, &Error.Code))
EndFor
endif
GAM API
• &Session = GAMsession.Get(&Errors)
if &Errors.Count = 0
&userGUID.FromString(GAMUser.GetId())
endif
• &GAMUser.load(&UserId)
&isok = &GAMUser.CheckRole(&RoleName)
• &GAMPermissions =
&GAMUser.GetPermissions(&GAMPermissionFilter,&errors)
• Y más…..
Autenticación Externa
•Autenticación:
•Custom
• Web services
Autenticación Externa
Autenticación Externa
•Versión 1.0
Autenticación Externa
•Versión 1.0
Autenticación Externa
•Versión 2.0
Autenticación Externa
•Versión 2.0
Autenticación Externa -Login
&AdditionalParameter.AuthenticationTypeName = “Custom”
&LoginOK = GAMRepository.Login(&UserName, &UserPassword,
&AdditionalParameter, &Errors )
If &LoginOK
&ApplicationData = GAMSession.GetApplicationData()
If not &ApplicationData.IsEmpty()
&GAMExampleSDTApplicationData.FromJson(&ApplicationDat
a)
Endif
Endif
CustomProperty = new()
&CustomProperty.Id = "LDAPpath"
&CustomProperty.Token = "LDAPpath"
&CustomProperty.Value =
"LDAP://server1.sampledomain.local/ou=promotions,
ou=marketing,dc=sampledomain,dc=local"
&AdditionalParameter.Properties.Add(&CustomProperty)
&CustomProperty = new()
&CustomProperty.Id = "LDAPFilter"
&CustomProperty.Token = "LDAPFilter"
&CustomProperty.Value = "sn=" + &surname
&AdditionalParameter.Properties.Add(&CustomProperty)
&AdditionalParameter.AuthenticationTypeName = “Custom”
&LoginOK = GAMRepository.Login(&UserName, &UserPassword,
&AdditionalParameter, &Errors )
Autenticación Externa
Event 'LoginCustom'
Composite
GeneXus.SD.Actions.LoginExternal(GAMAuthenticationTypes.Custom,
&User, &Password)
Return
EndComposite
Endevent
Autenticación Externa - Manejo de roles
•Only Authentication
•Authentication and Roles (roles se mapean por el
External Id)
Autorización delegada
Single Sign On
• Un único sign-in para todas las aplicaciones de mi
empresa
• GAM Remote Authentication Type
• GAM Proveedor de identidades utilizandoAuthorization
OAuth 2.0 Server
Single Sign On
IDENTITY GAM
PROVIDER
SERVER
Session
GAM Ask for GAM
LOGIN
Request
Request
SESSION SESSION
Response
App1 App2
Response