Child pages
  • Registration

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


ApstrataSDK code is available as open source from google code, to obtain the latest:




GitHub at

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


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


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


Installing the server side scripts


After installing the server side scripts in your apstrata account, go to the script named "widgets.common" and configure the following parameters:


Code Block
// The name of the project (or site) the user is subscribing to
var projectName = "";

// The name of the default group to which subscribing users will belong once registered
var defaultUsersGroup = "";

// The store where temporary registration documents will be created on the client application (user registration and/or account provisioning))
var defaultUnconfirmedRegistrationStore = "";    

// The url of the client application (user registration and/or account provisioning)
var apstrataHomeEnvironment = ";

// The auth key of the provisioning account on the client application
var apstrataHomeKey = "";

// The secret of the provisioning account on the client application
var apstrataHomeSecret = "";

// The type of registration that is required ("user" -> for user registration, or "account" -> for account creation)
var registrationType = "";

// Specify if an email should be sent to the user upon successful registration (true/false)
var sendEmailOnceRegistrationConfirmed = ;

// The URL that is sent in the verification e-mail for the subscriber to click on (you normally should not change this)
var verifyUrl = apstrataHomeEnvironment + "/apsdb/rest/" + apstrataHomeKey + "/RunScript?apsws.authMode=simple&apsdb.scriptName=widgets.Registration.verifyAccount&login=$login&d=$confirmation";

// The URL where to redirect the user after he submits his registration form
var registrationRedirectUrl = ""
var configuration = {
    projectName: projectName,
    defaultUsersGroup: defaultUsersGroup,
    defaultUnconfirmedRegistrationStore: defaultUnconfirmedRegistrationStore,    
    apstrataHomeEnvironment: apstrataHomeEnvironment,    
    apstrataHomeKey: apstrataHomeKey,
    registrationType: registrationType,
    registrationRedirectUrl: registrationRedirectUrl,
    sendEmailOnceRegistrationConfirmed: sendEmailOnceRegistrationConfirmed,    
    templates: {
        adminEmail: "",
        subject: "$projectName Registration - Email Verification",
        body: "<div style='font-family:Calibri, font-size:11'>Hello $user,<br/><br/> Thank you for signing up to our $projectName <br/><br/> Please click on the link below to activate your account. If the link doesn't work, copy and paste the link directly into the address bar of your internet browser.<br/><a href='$url'>$url</a><br/><br/>Sincerely<br/><br/>The $projectName Team",        
        verifyUrl: verifyUrl 

    templatesConfirmed: {
        adminEmail: "",
        subject: "$projectName Registration confirmed",
        body: "<div style='font-family:Calibri, font-size:11'>Hello $user,<br/><br/> Welcome to our $projectName <br/><br/> Your account has been activated.<br/>Sincerely<br/><br/>The $projectName Team",


NOTE: The above configuration assumes that the required stores have already been created in the apstrata account.


Embedding the widget in your web application

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

    Code Block
    <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/RegistrationWidget.css>";
  2. Include the apstrata configuration file and the registration widget file

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

    Code Block
    var rw = new apstrata.ui.widgets.RegistrationWidget(), dojo.body())


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