LDAP component



Most apps require a user to register and login with credentials. Most often, the app requires that the user create a user/password that is specific to the app. This is a cumbersome process that requires the user to remember yet one more password. It’s also not very secure.


A much better approach is to enable the user to simply log in with existing credentials from another service that is trusted, like an LDAP directory in an enterprise


LDAP, or Lightweight Directory Access Protocol, is an internet protocol that programs use to look up information from a server. LDAP can be used to look up encryption certificates, pointers to printers and other services on a network, and provides “single sign-on,” where one password for a user is shared between many services. It’s typically used by enterprise organizations.


Appery.io offers powerful and flexible mechanism of creating secured mobile applications which use your LDAP.




To understand how it works in details let consider example




  1. Create API Express project with name SecuredProject
  2. Go to Settings sub tab
  3. Enable Secure REST API
  4. Select Security type Custom service
  5. Came back to API sub tab
  6. Open login service in system folder (just press edit link)
  7. Remove default SCRIPT component from flow
  8. Add LDAP component instead
  9. Provide following values for properties of LDAP component
    1. Provider type: LDAP
    2. Host: ldap.forumsys.com
    3. Port: 389
    4. User DN: cn=read-only-admin,dc=example,dc=com
    5. Admin Password: password
    6. Username:  BODY.username
    7. Password:  BODY.password
    8. Base DN: dc=example,dc=com
    9. Object classes: person
    10. User login name field: uid
  10. Press Generate button to make sure that configuration is correct
  11. In open popup specify
    1. Username: riemann
    2. Password: password
  12. Press Run LDAP button
  13. Response field should be
{
   "status": "success",
   "session": {
       "userId": "riemann",
       "userName": "riemann"
   }
}
  1. Press Import Response button and Save button
  2. Press Test button
  3. In new opened window specify Request body payload (data).
{
   "username": "riemann",
   "password": "password",
   "options": {}
}
  1. The response of login service should look like
{
       "sessionToken": "f735cb5d-ea48-4fca-be2e-9ebfdd98e6ca"
}


  1. It means that we successfully logged in our project and got session token which can be used subsequently to perform rest calls to another services of this project.



Comments