SlideShare a Scribd company logo
1 of 21
Business APIs
Darwino high level APIs – User Service
Business APIs
• Darwino features a set of business APIs, providing an encapsulated access to
services
– User Service
– Mail Service
– Preference services
– API description
– Mobile validation
– Command and Profiler, Proxy….
• The set of encapsulated API will grow over time (File service…)
User Service and Data Providers
• The whole Darwino runtime uses a single User object encapsulation, along
with a service that acts on users
• The users can come from different sources
– LDAP, IBM Connections, MS Azure…
– Data from multiple sources can be aggregated and seen as one consistent user
object
• The user service can be user to authenticate a user, using a user/password
User Service Concepts
• There is one User Service per Darwino application (runtime)
– Main access point to the users
– Defines what is the unique ID of a user. Depends on the implementation
• LDAP dn/attribute, IBM Connections guid, …
• There might be one or multiple User Data Providers with a User Service
– A data provider extends users with extra data, coming from another source
• User attributes
• User binary pieces (pictures, …)
– A data provider uses an identity mapper to identify users between multiple
sources
Anatomy of a User
• A user is identified by a unique id, called a dn
– Note that the dn is internal to Darwino. It dows not have to be an LDAP dn
• A user has a series of attributes: common name, email…
– No constraint exist on the attributes, but a series of default names is provided as
constants. These names should used for the standard attributes
• A user can provide binary pieces (ex: photo, …)
• A user has groups and roles
– Groups are generally coming from the underlying directory
– Roles are generally provided by the application
Configuring the User Service
• A service can be provided by an API, or use a managed bean
• Darwino comes with some implementations:
– Static list of users (development or simple apps)
– LDAP
– IBM Connections Cloud
– MS Azure AD
Configuring a Data Provider
• Data providers can be added to any user service
• Available providers
– IBM Connections (data, picture…)
– Gravatar (for user pictures)
<property name="uc">com.darwino.config.user.UserDirStatic$User</property>
<bean type="darwino/userdir" name="base" class="com.darwino.config.user.UserDirStatic" alias="demo,default">
<list name="providers">
<bean class='com.darwino.ibm.connections.IbmConnectionsUserProvider' optional='true'>
<property name='emailFilter'>*@triloggroup.com</property>
<property name='identityMapper'>
<bean class='com.triloggroup.darwino.user.TGLC45IdentityMapper'></bean>
</property>
</bean>
</list>
<list name="users">
<bean class='${uc}'>
<property name='dn'>cn=Philippe Riand,o=TRILOG</property>
<property name='cn'>Philippe Riand</property>
<property name='uid'>phil</property>
<property name='email'>phil@triloggroup.com</property>
<property name='password'>darwino</property>
<list name='roles'>
<value>admin</value>
</list>
<list name='groups'>
<value>darwino</value>
</list>
</bean>
</list>
</bean>
Configuring a Simple User Service
Property reusable across the file
Map static identity to IBM Connections
Get extra data from IBM Connections
Definition of a static user
Adding Application Roles to Users
• Roles are added to users using a role provider
• Static roles can easily be assigned, but a custom role provider
implementation can be provided to resolve more dynamic cases
• Roles can also be assigned on a per instance basis
– The same physical user can have different roles in different tenant
<bean name="roleProvider" class="com.darwino.config.user.UserRoleStatic">
<list name="roles">
<bean class='com.darwino.config.user.UserRoleStatic$Role'>
<property name='name'>admin</property>
<list name='users'>
<value>20098922</value>
</list>
</bean>
</list>
</bean>
Configuring an LDAP Service
• Several LDAP servers are supported out of the box through JNDI
– MS AD, IBM Tivoli, IBM Domino, Oracle Directory…
• Custom LDAP server or schemas can be supported
– By configuring the attribute mapping of the service
– By providing a custom service implementation
LDAP Configuration Example Using IBM Domino
<bean type="darwino/userdir" name="ldapDomino" class="com.darwino.config.user.UserDirLdap">
<property name='schema'>
<bean class=".DominoSchema">
<property name='maxResults'>30</property>
<map name='mappings'>
<bean key='mailFile' class=".Attr">
<property name='mapping'>mailfile</property>
</bean>
</map>
<list name='userContexts'>
<value>O=Trilog1Test</value>
</list>
<list name='groupContexts'>
<value></value>
</list>
</bean>
</property>
<property name='url'>ldap://50.241.77.11:4389</property>
<property name='securityAuthentication'>simple</property>
<property name='securityPrincipal'>${dwo.junit.ldap.domino.user}</property>
<property name='securityCredentials'>${dwo.junit.ldap.domino.password}</property>
<property name='loadGroups'>true</property>
<property name='recursiveGroups'>true</property>
<property name='loadRoles'>true</property>
<property name='roleProvider'>
<bean-ref name="_roles"></bean-ref>
</property>
</bean>
Configuring IBM Connections
<bean type="darwino/ibmconnections" name="tglc5demo" class="com.darwino.ibm.connections.IbmConnections">
<property name="url">https://tglc5demo.triloggroup.com/</property>
<property name="trustAllSSLCertificates">true</property>
<bean name="basicCredentials">
<property name="user">${connections.tglc5demo.basic.user}</property>
<property name="password">${connections.tglc5demo.basic.password}</property>
</bean>
<bean name="oauthCredentials">
<property name="consumerKey">${connections.tglc5demo.oauth2.clientid}</property>
<property name="consumerSecret">${connections.tglc5demo.oauth2.clientSecret}</property>
</bean>
</bean>
<bean type="darwino/userdir" name="base" class="com.darwino.ibm.connections.IbmConnectionsUserDir" alias="discdb">
<property name='allowUnknownUsers'>true</property>
<list name="providers">
<bean class='com.darwino.social.gravatar.GravatarUserProvider' optional='true' enabled='true'></bean>
</list>
<bean name="roleProvider" class="com.darwino.config.user.UserRoleStatic">
<list name="roles">
<bean class='com.darwino.config.user.UserRoleStatic$Role'>
<property name='name'>admin</property>
<list name='users'>
<value>20098922</value>
</list>
</bean>
</list>
</bean>
</bean>
Cloud or on-premises URL
Configuring Microsoft Azure AD
<bean type="darwino/msazure" name="azure" class="com.darwino.microsoft.o365.AzureAD" alias="demo,default">
<property name="trustAllSSLCertificates">true</property>
<property name="appId">${azure.oauth2.appid}</property>
<property name="tenantId">${azure.oauth2.tenantid}</property>
<bean name="webCredentials">
<property name="clientId">${azure.oauth2.web.clientid}</property>
<property name="clientSecret">${azure.oauth2.web.clientsecret}</property>
</bean>
</bean>
<bean type="darwino/userdir" name="base" class="com.darwino.microsoft.o365.AzureADUserDir" alias="discdb">
<property name='allowUnknownUsers'>true</property>
<list name="providers">
<bean class='com.darwino.social.gravatar.GravatarUserProvider' optional='true' enabled='true'></bean>
</list>
<bean name="roleProvider" class="com.darwino.config.user.UserRoleStatic">
<list name="roles">
<bean class='com.darwino.config.user.UserRoleStatic$Role'>
<property name='name'>admin</property>
<list name='users'>
<value>d442c454-838c-4875-8b16-6612e9ccd4ca</value>
</list>
</bean>
</list>
</bean>
</bean>
User Service Java API
• The user service is a singleton within the Darwino runtime
Platform.getService(UserService.class)
User Service REST APIs
• All the user related services are available with a REST API
User Service JavaScript API
• The JavaScript API runs within a browser and connects to the REST service
– The API is asynchronous
– When a user is not available, it returns a temporary object that will be updated
when the result comes back from the server
• It maintains an in memory cache to not duplicate the requests to the server
• It supports @me for the current user
• Can batches several user requests into a single one, to minimize the # of
requests
– Ex: result of a query with one use per row
User Service on Mobile Devices
• The mobile implementation uses the REST services to call the server
• A persistent cache, using Darwino DB, is activated
– Enables the offline mode
– Increases the performance even when connected as it decreases the # of
requests
– Has a discard local data strategy
• The service is activated by default
Creating your Own User Service
• Creating a custom user service requires
– A user service inheriting from UserServiceImpl
• Handles many details, like in memory caching…
– A user object class inheriting from UserImpl
• Creating a custom data provider
– A data provider inheriting from UserProviderImpl
• See WebGate self registration database
Quick E-Mail Service Overview
• Darwino provides an easy service to sent e-mail
– Delegates to the underlying implementation through drivers
• Java Mail, JNDI Java Mail…
– Supports Basic, TLS or SSL transport
– Defined as a Bean
• Simple but complete APIs
– Sends text and HTML content
– Support binary attachments
Quick Preferences Service Overview
• The preference service can read and store preferences on a user basis
• Preferences are accessed using extensions
– Extension example is using in memory storage
• Creating a custom storage is easy
• The service will provide more storage options in the future
– JSON database
– Java preferences API
Thank you for your attention!

More Related Content

What's hot

Active directory ds ws2008 r2
Active directory ds ws2008 r2Active directory ds ws2008 r2
Active directory ds ws2008 r2
MICTT Palma
 

What's hot (7)

Active directory ds ws2008 r2
Active directory ds ws2008 r2Active directory ds ws2008 r2
Active directory ds ws2008 r2
 
12 ibm connections integration
12   ibm connections integration12   ibm connections integration
12 ibm connections integration
 
Develop Engaging and High Performance Portal Themes That Power Exceptional Di...
Develop Engaging and High Performance Portal Themes That Power Exceptional Di...Develop Engaging and High Performance Portal Themes That Power Exceptional Di...
Develop Engaging and High Performance Portal Themes That Power Exceptional Di...
 
Unit4wt
Unit4wtUnit4wt
Unit4wt
 
Data load utility
Data load utilityData load utility
Data load utility
 
Java Framework for Database-Centric Web Engineering
Java Framework for Database-Centric Web EngineeringJava Framework for Database-Centric Web Engineering
Java Framework for Database-Centric Web Engineering
 
Ad ds ws2008 r2
Ad ds ws2008 r2Ad ds ws2008 r2
Ad ds ws2008 r2
 

Similar to 09 business apis

Azure data analytics platform - A reference architecture
Azure data analytics platform - A reference architecture Azure data analytics platform - A reference architecture
Azure data analytics platform - A reference architecture
Rajesh Kumar
 
Learning to code for startup mvp session 3
Learning to code for startup mvp session 3Learning to code for startup mvp session 3
Learning to code for startup mvp session 3
Henry S
 
Domain-Specific Languages for Composable Editor Plugins (LDTA 2009)
Domain-Specific Languages for Composable Editor Plugins (LDTA 2009)Domain-Specific Languages for Composable Editor Plugins (LDTA 2009)
Domain-Specific Languages for Composable Editor Plugins (LDTA 2009)
lennartkats
 

Similar to 09 business apis (20)

06 web applications
06   web applications06   web applications
06 web applications
 
2015 zData Inc. - Apache Ambari Overview
2015 zData Inc. - Apache Ambari Overview2015 zData Inc. - Apache Ambari Overview
2015 zData Inc. - Apache Ambari Overview
 
Java Developers, make the database work for you (NLJUG JFall 2010)
Java Developers, make the database work for you (NLJUG JFall 2010)Java Developers, make the database work for you (NLJUG JFall 2010)
Java Developers, make the database work for you (NLJUG JFall 2010)
 
SOA for PL/SQL Developer (OPP 2010)
SOA for PL/SQL Developer (OPP 2010)SOA for PL/SQL Developer (OPP 2010)
SOA for PL/SQL Developer (OPP 2010)
 
Azure data analytics platform - A reference architecture
Azure data analytics platform - A reference architecture Azure data analytics platform - A reference architecture
Azure data analytics platform - A reference architecture
 
SFScon 2020 - Nikola Milisavljevic - BASE - Python REST API framework
SFScon 2020 - Nikola Milisavljevic - BASE - Python REST API frameworkSFScon 2020 - Nikola Milisavljevic - BASE - Python REST API framework
SFScon 2020 - Nikola Milisavljevic - BASE - Python REST API framework
 
Learning to code for startup mvp session 3
Learning to code for startup mvp session 3Learning to code for startup mvp session 3
Learning to code for startup mvp session 3
 
Mule MMC Integration with LDAP
Mule MMC Integration with LDAPMule MMC Integration with LDAP
Mule MMC Integration with LDAP
 
Advance java session 19
Advance java session 19Advance java session 19
Advance java session 19
 
Frame - Feature Management for Productive Machine Learning
Frame - Feature Management for Productive Machine LearningFrame - Feature Management for Productive Machine Learning
Frame - Feature Management for Productive Machine Learning
 
SharePoint 2013 - What's New
SharePoint 2013 - What's NewSharePoint 2013 - What's New
SharePoint 2013 - What's New
 
Cause 2013: A Flexible Approach to Creating an Enterprise Directory
Cause 2013: A Flexible Approach to Creating an Enterprise DirectoryCause 2013: A Flexible Approach to Creating an Enterprise Directory
Cause 2013: A Flexible Approach to Creating an Enterprise Directory
 
Applying Novell Identity Manager to Your Everyday Problems
Applying Novell Identity Manager to Your Everyday ProblemsApplying Novell Identity Manager to Your Everyday Problems
Applying Novell Identity Manager to Your Everyday Problems
 
IBM Spectrum Scale Authentication for Protocols
IBM Spectrum Scale Authentication for ProtocolsIBM Spectrum Scale Authentication for Protocols
IBM Spectrum Scale Authentication for Protocols
 
Integrate with ldap
Integrate with ldapIntegrate with ldap
Integrate with ldap
 
Domain-Specific Languages for Composable Editor Plugins (LDTA 2009)
Domain-Specific Languages for Composable Editor Plugins (LDTA 2009)Domain-Specific Languages for Composable Editor Plugins (LDTA 2009)
Domain-Specific Languages for Composable Editor Plugins (LDTA 2009)
 
JavaOne 2014 - Supporting Multi-tenancy Applications with Java EE
JavaOne 2014 - Supporting Multi-tenancy Applications with Java EEJavaOne 2014 - Supporting Multi-tenancy Applications with Java EE
JavaOne 2014 - Supporting Multi-tenancy Applications with Java EE
 
SCIM presentation from CIS 2012
SCIM presentation from CIS 2012SCIM presentation from CIS 2012
SCIM presentation from CIS 2012
 
Ambari Views - Overview
Ambari Views - OverviewAmbari Views - Overview
Ambari Views - Overview
 
Elements for an iOS Backend
Elements for an iOS BackendElements for an iOS Backend
Elements for an iOS Backend
 

More from darwinodb

More from darwinodb (14)

17 open ntf-v30-darwinoorg
17   open ntf-v30-darwinoorg17   open ntf-v30-darwinoorg
17 open ntf-v30-darwinoorg
 
16 endeavour reporter
16   endeavour reporter16   endeavour reporter
16 endeavour reporter
 
15 darwino script & command line
15   darwino script & command line15   darwino script & command line
15 darwino script & command line
 
14 integrating watson services
14   integrating watson services14   integrating watson services
14 integrating watson services
 
13 deploying cloud applications
13   deploying cloud applications13   deploying cloud applications
13 deploying cloud applications
 
11 advanced replication
11   advanced replication11   advanced replication
11 advanced replication
 
10 domino integration
10   domino integration10   domino integration
10 domino integration
 
08 mobile development
08   mobile development08   mobile development
08 mobile development
 
07 darwino rest services
07   darwino rest services07   darwino rest services
07 darwino rest services
 
05 darwino db
05   darwino db05   darwino db
05 darwino db
 
04 darwino concepts and utility classes
04   darwino concepts and utility classes04   darwino concepts and utility classes
04 darwino concepts and utility classes
 
02 configuration
02   configuration02   configuration
02 configuration
 
01 introduction to darwino
01   introduction to darwino01   introduction to darwino
01 introduction to darwino
 
IBM ConnectED SPOT104: Lightning-Fast Development of Native Mobile Apps for I...
IBM ConnectED SPOT104: Lightning-Fast Development of Native Mobile Apps for I...IBM ConnectED SPOT104: Lightning-Fast Development of Native Mobile Apps for I...
IBM ConnectED SPOT104: Lightning-Fast Development of Native Mobile Apps for I...
 

Recently uploaded

+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
masabamasaba
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 

Recently uploaded (20)

OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 

09 business apis

  • 1. Business APIs Darwino high level APIs – User Service
  • 2. Business APIs • Darwino features a set of business APIs, providing an encapsulated access to services – User Service – Mail Service – Preference services – API description – Mobile validation – Command and Profiler, Proxy…. • The set of encapsulated API will grow over time (File service…)
  • 3. User Service and Data Providers • The whole Darwino runtime uses a single User object encapsulation, along with a service that acts on users • The users can come from different sources – LDAP, IBM Connections, MS Azure… – Data from multiple sources can be aggregated and seen as one consistent user object • The user service can be user to authenticate a user, using a user/password
  • 4. User Service Concepts • There is one User Service per Darwino application (runtime) – Main access point to the users – Defines what is the unique ID of a user. Depends on the implementation • LDAP dn/attribute, IBM Connections guid, … • There might be one or multiple User Data Providers with a User Service – A data provider extends users with extra data, coming from another source • User attributes • User binary pieces (pictures, …) – A data provider uses an identity mapper to identify users between multiple sources
  • 5. Anatomy of a User • A user is identified by a unique id, called a dn – Note that the dn is internal to Darwino. It dows not have to be an LDAP dn • A user has a series of attributes: common name, email… – No constraint exist on the attributes, but a series of default names is provided as constants. These names should used for the standard attributes • A user can provide binary pieces (ex: photo, …) • A user has groups and roles – Groups are generally coming from the underlying directory – Roles are generally provided by the application
  • 6. Configuring the User Service • A service can be provided by an API, or use a managed bean • Darwino comes with some implementations: – Static list of users (development or simple apps) – LDAP – IBM Connections Cloud – MS Azure AD
  • 7. Configuring a Data Provider • Data providers can be added to any user service • Available providers – IBM Connections (data, picture…) – Gravatar (for user pictures)
  • 8. <property name="uc">com.darwino.config.user.UserDirStatic$User</property> <bean type="darwino/userdir" name="base" class="com.darwino.config.user.UserDirStatic" alias="demo,default"> <list name="providers"> <bean class='com.darwino.ibm.connections.IbmConnectionsUserProvider' optional='true'> <property name='emailFilter'>*@triloggroup.com</property> <property name='identityMapper'> <bean class='com.triloggroup.darwino.user.TGLC45IdentityMapper'></bean> </property> </bean> </list> <list name="users"> <bean class='${uc}'> <property name='dn'>cn=Philippe Riand,o=TRILOG</property> <property name='cn'>Philippe Riand</property> <property name='uid'>phil</property> <property name='email'>phil@triloggroup.com</property> <property name='password'>darwino</property> <list name='roles'> <value>admin</value> </list> <list name='groups'> <value>darwino</value> </list> </bean> </list> </bean> Configuring a Simple User Service Property reusable across the file Map static identity to IBM Connections Get extra data from IBM Connections Definition of a static user
  • 9. Adding Application Roles to Users • Roles are added to users using a role provider • Static roles can easily be assigned, but a custom role provider implementation can be provided to resolve more dynamic cases • Roles can also be assigned on a per instance basis – The same physical user can have different roles in different tenant <bean name="roleProvider" class="com.darwino.config.user.UserRoleStatic"> <list name="roles"> <bean class='com.darwino.config.user.UserRoleStatic$Role'> <property name='name'>admin</property> <list name='users'> <value>20098922</value> </list> </bean> </list> </bean>
  • 10. Configuring an LDAP Service • Several LDAP servers are supported out of the box through JNDI – MS AD, IBM Tivoli, IBM Domino, Oracle Directory… • Custom LDAP server or schemas can be supported – By configuring the attribute mapping of the service – By providing a custom service implementation
  • 11. LDAP Configuration Example Using IBM Domino <bean type="darwino/userdir" name="ldapDomino" class="com.darwino.config.user.UserDirLdap"> <property name='schema'> <bean class=".DominoSchema"> <property name='maxResults'>30</property> <map name='mappings'> <bean key='mailFile' class=".Attr"> <property name='mapping'>mailfile</property> </bean> </map> <list name='userContexts'> <value>O=Trilog1Test</value> </list> <list name='groupContexts'> <value></value> </list> </bean> </property> <property name='url'>ldap://50.241.77.11:4389</property> <property name='securityAuthentication'>simple</property> <property name='securityPrincipal'>${dwo.junit.ldap.domino.user}</property> <property name='securityCredentials'>${dwo.junit.ldap.domino.password}</property> <property name='loadGroups'>true</property> <property name='recursiveGroups'>true</property> <property name='loadRoles'>true</property> <property name='roleProvider'> <bean-ref name="_roles"></bean-ref> </property> </bean>
  • 12. Configuring IBM Connections <bean type="darwino/ibmconnections" name="tglc5demo" class="com.darwino.ibm.connections.IbmConnections"> <property name="url">https://tglc5demo.triloggroup.com/</property> <property name="trustAllSSLCertificates">true</property> <bean name="basicCredentials"> <property name="user">${connections.tglc5demo.basic.user}</property> <property name="password">${connections.tglc5demo.basic.password}</property> </bean> <bean name="oauthCredentials"> <property name="consumerKey">${connections.tglc5demo.oauth2.clientid}</property> <property name="consumerSecret">${connections.tglc5demo.oauth2.clientSecret}</property> </bean> </bean> <bean type="darwino/userdir" name="base" class="com.darwino.ibm.connections.IbmConnectionsUserDir" alias="discdb"> <property name='allowUnknownUsers'>true</property> <list name="providers"> <bean class='com.darwino.social.gravatar.GravatarUserProvider' optional='true' enabled='true'></bean> </list> <bean name="roleProvider" class="com.darwino.config.user.UserRoleStatic"> <list name="roles"> <bean class='com.darwino.config.user.UserRoleStatic$Role'> <property name='name'>admin</property> <list name='users'> <value>20098922</value> </list> </bean> </list> </bean> </bean> Cloud or on-premises URL
  • 13. Configuring Microsoft Azure AD <bean type="darwino/msazure" name="azure" class="com.darwino.microsoft.o365.AzureAD" alias="demo,default"> <property name="trustAllSSLCertificates">true</property> <property name="appId">${azure.oauth2.appid}</property> <property name="tenantId">${azure.oauth2.tenantid}</property> <bean name="webCredentials"> <property name="clientId">${azure.oauth2.web.clientid}</property> <property name="clientSecret">${azure.oauth2.web.clientsecret}</property> </bean> </bean> <bean type="darwino/userdir" name="base" class="com.darwino.microsoft.o365.AzureADUserDir" alias="discdb"> <property name='allowUnknownUsers'>true</property> <list name="providers"> <bean class='com.darwino.social.gravatar.GravatarUserProvider' optional='true' enabled='true'></bean> </list> <bean name="roleProvider" class="com.darwino.config.user.UserRoleStatic"> <list name="roles"> <bean class='com.darwino.config.user.UserRoleStatic$Role'> <property name='name'>admin</property> <list name='users'> <value>d442c454-838c-4875-8b16-6612e9ccd4ca</value> </list> </bean> </list> </bean> </bean>
  • 14. User Service Java API • The user service is a singleton within the Darwino runtime Platform.getService(UserService.class)
  • 15. User Service REST APIs • All the user related services are available with a REST API
  • 16. User Service JavaScript API • The JavaScript API runs within a browser and connects to the REST service – The API is asynchronous – When a user is not available, it returns a temporary object that will be updated when the result comes back from the server • It maintains an in memory cache to not duplicate the requests to the server • It supports @me for the current user • Can batches several user requests into a single one, to minimize the # of requests – Ex: result of a query with one use per row
  • 17. User Service on Mobile Devices • The mobile implementation uses the REST services to call the server • A persistent cache, using Darwino DB, is activated – Enables the offline mode – Increases the performance even when connected as it decreases the # of requests – Has a discard local data strategy • The service is activated by default
  • 18. Creating your Own User Service • Creating a custom user service requires – A user service inheriting from UserServiceImpl • Handles many details, like in memory caching… – A user object class inheriting from UserImpl • Creating a custom data provider – A data provider inheriting from UserProviderImpl • See WebGate self registration database
  • 19. Quick E-Mail Service Overview • Darwino provides an easy service to sent e-mail – Delegates to the underlying implementation through drivers • Java Mail, JNDI Java Mail… – Supports Basic, TLS or SSL transport – Defined as a Bean • Simple but complete APIs – Sends text and HTML content – Support binary attachments
  • 20. Quick Preferences Service Overview • The preference service can read and store preferences on a user basis • Preferences are accessed using extensions – Extension example is using in memory storage • Creating a custom storage is easy • The service will provide more storage options in the future – JSON database – Java preferences API
  • 21. Thank you for your attention!