Skip to end of metadata
Go to start of metadata


The Login Widget provides user interface functionality to authenticate account owners or apstrata users registered under an apstrata account. Once the widget is placed in a web application page, it displays a form where a user can enter his credentials to login to the web application.

The "type" attribute of the widget specifies whether the widget is used to authenticate account owners or apstrata users.

Getting the code for the Apstrata SDK

ApstrataSDK code is available as open source from GitHub at

ApstrataSDK depends on the dojo 1.6 framework, you can download from here:

Installing the Apstrata SDK

  1. Unpack the dojo zip file into your web application
  2. Copy the ApstrataSDK into your web application
  3. Define where the ApstrataSDK is located by including the following code in your main web application page

    dojo.registerModulePath("apstrata", "<path to ApstrataSDK/apstrata subfolder>") 

Configuring the Apstrata Connection Parameters

You need to set the apstrata connection parameters in the file ApstrataSDK/apstrata/sdk/ApConfig.js to use you account authentication key and secret.


    "apstrata.sdk": {
        "Connection" : {
            credentials: {
                key: "<the authentication key of your apstrata account>",
            serviceURL: '<the apstrata base URL, i.e.>',
            timeout: <the connection timeout in milliseconds>


Embedding the widget in your web application

  1. Make sure to reference the dojo and apstrata core scripts and css files

    <script type="text/javascript" src="<relative path to dojo/dojo.js>" djConfig="parseOnLoad: true"></script>
    <script type="text/javascript" src="<relative path to ApstrataSDK/apstrata/sdk/apstrata.js>"></script>
    	@import "<relative path to dojo/dijit/themes/claro/claro.css>";
    	@import "<relative path to ApstrataSDK/apstrata/ui/themes/apstrata/apstrata.css>";
    	@import "<relative path to ApstrataSDK/apstrata/ui/themes/apstrata/LoginWidget.css>";
  2. Include the apstrata configuration file and the registration widget file

  3. Instantiate the registration widget and place it in your web application page

    //users authentication
    var lw = new apstrata.ui.widgets.LoginWidget({type: "user"}), dojo.body())
    //account owners authentication
    var lw = new apstrata.ui.widgets.LoginWidget({type: "master"}), dojo.body())


Please refer to the file "ApstrataSDK/apstrata\ui/widgets/tests/test-Login.html" for a complete example on how to embed the widget

  • No labels