Skip navigation
All People > banty01 > Tyler Band's Blog > 2016 > September > 06
banty01

LDAP Authentication Provider

Posted by banty01 Employee Sep 6, 2016

CA Live API Creator (LAC) provides a built-in authentication service for both the admin service (e.g. 'sa') and the user-admin.  Replacing the authentication service with a JavaScript library has been documented here.  A great example of a custom authentication service is shipped with the stand-alone package and B2B example.

 

A sample LDAP Java library and JavaScript have been posted to GitHub here.  The process requires a modification to the Java code to match the corporate specification of the internal LDAP system.  Once completed and tested, create a JAR file and copy this to your /lib directory.  The next step is to load the JavaScript library into LAC and then to create a new Authentication Provider service using the new JavaScript library and JAR file. 

 

Once the new Authentication Provider service is in place and tested, it can be used by both the internal admin service and the end user access of REST API endpoints.  

banty01

Using Amazon S3 File Storage

Posted by banty01 Employee Sep 6, 2016

Connecting your Live API Creator to Amazon S3 (File Storage)

 

I have been working with a partner that had a specific need to extract the contents of a Microsoft Excel spreadsheet into a database.  They will be using Live API Creator running on Amazon (AWS) using Elastic Beanstalk (EBS).  The setup is documented here - but the key was to add the correct Amazon JAR files to the installation (.ebsextensions/JDBCDrivers.config) shown below.  The second part is to create a Java Class and library (see their samples ) that you will load as a user library (JAR) in Live API Creator.  Using a rule or event, you can call the new Java wrapper function.  The trick is to either pass in the accessKey and secretKey (replace their sample code with new BasicAWSCredentials(accessKey,secretAccessKey) );  The other trick is to make sure you have set the access rights for each file you plan to read to allow this user read privileges.

 

var ReadFileFromS3 = Java.type("com.mycompany.s3.ReadFileFromS3");

var myFile =new ReadFileFromS3(buckeName, key, accessKey, secretAccessKey);

 

Sample JDBCDrivers.config for Amazon S3

  "/usr/share/tomcat8/lib/aws-java-sdk-core-1.11.9.jar":

     mode: "000755"

     owner: tomcat

     group: tomcat

     source: http://central.maven.org/maven2/com/amazonaws/aws-java-sdk-core/1.11.9/aws-java-sdk-core-1.11.9.jar

 

  "/usr/share/tomcat8/lib/aws-java-sdk-kms-1.11.9.jar":

     mode: "000755"

     owner: tomcat

     group: tomcat

     source: http://central.maven.org/maven2/com/amazonaws/aws-java-sdk-kms/1.11.9/aws-java-sdk-kms-1.11.9.jar

 

  "/usr/share/tomcat8/lib/aws-java-sdk-s3-1.11.9.jar":

     mode: "000755"

     owner: tomcat

     group: tomcat

     source: http://central.maven.org/maven2/com/amazonaws/aws-java-sdk-s3/1.11.9/aws-java-sdk-s3-1.11.9.jar

 

  "/usr/share/tomcat8/lib/joda-time-2.9.4.jar":

     mode: "000755"

     owner: tomcat

     group: tomcat

     source: http://central.maven.org/maven2/joda-time/joda-time/2.9.4/joda-time-2.9.4.jar