Docs‎ > ‎API Creator‎ > ‎Security‎ > ‎Authentication‎ > ‎Authentication Providers‎ > ‎

Hello World Authentication Provider

The Hello World Authentication Provider has been created to demonstrate the process of creating, installing and using a custom JavaScript authentication provider.
The sample authentication provider (HelloWorldAuthenticationProvider.js) contains a lot of comments and should give you a good idea of how to implement your own.

Overview of Process

  1. Download attached files and place in a convenient directory.
  2. Install a Java runtime, Java 1.6 or later is required.
  3. From the command line, execute: java -version
    (verify java version and functionality)
  4. ./hw.sh runs a simple hw.js test stub which invokes the auth provider locally outside of the API Server. When you are developing your own provider, this provides a quick turn-around environment. The full capabilities of the server are not available.
  5. Upload HelloWorldAuthenticationProvider.js to 'Your Libraries' on the Project tab and mark the library as Used.
  6. On the 'Authentication Providers' tab, add a new provider and select the JavaScript Authentication Method.  Enter a convenient name and description
  7. Enter 'helloWorldAuthenticationProviderCreate' as the name of the function. Note the small 'h', and click Save.
    The two configuration parameters are displayed (see screen shot below).
  8. On the Settings tab for the project, select the new provider and save
    You should now be able to use your authentication provider by calling the @authentication service. An easy way to test this is using the command line.


ċ
EspressoAuthenticationTest.jar
(5k)
Laura Carrubba,
Feb 16, 2016, 2:40 PM
ċ
HelloWorldAuthenticationProvider.js
(4k)
Laura Carrubba,
Feb 16, 2016, 2:39 PM
ċ
Screen Shot 2014-07-21 at 5.08.52 AM.png
(67k)
Laura Carrubba,
Feb 16, 2016, 2:39 PM
ċ
commons-logging-1.1.1.jar
(59k)
Laura Carrubba,
Feb 16, 2016, 2:40 PM
ċ
httpclient-4.2.5.jar
(423k)
Laura Carrubba,
Feb 16, 2016, 2:40 PM
ċ
httpcore-4.2.4.jar
(222k)
Laura Carrubba,
Feb 16, 2016, 2:39 PM
ċ
hw.js
(2k)
Laura Carrubba,
Feb 16, 2016, 2:40 PM
ċ
hw.sh
(0k)
Laura Carrubba,
Feb 16, 2016, 2:40 PM
ċ
rhino-1.7R4.jar
(1108k)
Laura Carrubba,
Feb 16, 2016, 2:39 PM
Comments