Government Services Infrastructure - GSi

GSi
Overview
Why GSi?
Features
 
Understanding GSi
Terminology
GSi Philosophy
Roles Involved
Technical Overview
Typical Implementation
 
Getting Started
License
Download
Install Instructions
 
Documentation
Developer Guide
Vertical API Guide
Toolset Guide
GovServices API Guides
FAQ
 
Demos
Create Process
Monitor Process
 
Download
Binaries
Source Code
 
Access Service API Guide

 

Overview.. 3

Introduction. 3

Getting Started. 3

Pre-requisite. 3

Java Client API Reference. 3

Construct AccessManager 3

login. 4

getAuthInfo. 4

changePassword. 5

resetPassword. 5

getLoggedInUsers. 6

 


Overview

 

This document explains in detail the functions that can be invoked to validate and authenticate the user, get user authorization information and other user related functions

Introduction

 

Using Access Services API below tasks can be performed.

  • Validate the user.
  • Get the authorization for the user.
  • Change user password
  • Reset user password
  • Log out the user.
  • Get the entire logged in user.

All the above operations are exposed through the Access Services API.

 

Getting Started

Pre-requisite  

Make the necessary configuration in application server (Refer to SPI) and put the required jars in the class path.

 

Java Client API Reference

Distribution comes with the Access Manager API jar file.  All access to API is encapsulated in one class AccessManager (Package: com.comat.govservices.access.mgr) and this class is used to invoke the methods provided by the Access Services API.

 

For detailed information, refer to the Javadoc API documents provided with the distribution.

 

Construct AccessManager

 

AccessManager Creation

 

The instance of the ‘AccessManager’ needs to be created to invoke the access services API.

 
 
Sample Usage:
AccessManager accessManager = new AccessManager();
 
 

login

Validates the User.

 

Signature:

      int login(String loginName, String password)

 

Parameters:

            loginName – Login Name

            password – Password in encrypted format

Returns:

        1 – Successful login.
        2 – Login failed.
        3 – User Locked 
 
Sample Usage:
String loginName = “superUser”;
String password = “super”;//Note:This is not in encrypted format.
AccessManager accessManager = new AccessManager();
int returnValue = accessManager.login(loginName,password)

Note:  Use the above method only if transaction is being maintained by the application server. In all the other cases use the variant of the above method.  Usage of the variant method is as below.

 

int loginForOtherService (String loginName, String password)

 

Note the change in the name of the method. Parameters and return values remains the same as above.

 

getAuthInfo

Returns the Authorization information for the given login name. Authorization information contains User details like organization, roles, resources and privileges

 

Signature:

        java.util.Map getAuthInfo (String loginName)

 

Parameters:

loginName – Login Name

 

Returns:

java.util.Map - Key – User type, Value –

If userType – 1, value  - com.comat.gsi.govservices.common.dto.CSCAuthInfo

userType – 2 or 3 or 4 or 5, value - com.comat.gsi.govservices.common.dto. OfficialAuthInfo

           

 

Sample Usage:
String loginName = “superUser”;
AccessManager accessManager = new AccessManager();
Map authInfo = accessManager. getAuthInfo (loginName)
 

 

changePassword

Change password for the given loginName.

 

Signature:

int changePassword (String loginName, String oldpassword, String newpassword)
 

Parameters:

loginName  – Login Name

oldpassword – Old password in encrypted format.

newpassword – New password as it is.

 

Returns:

            1 on success , 0 on failure

Sample Usage:
String loginName = “superUser”;
String oldpassword = “super”;//Note:This is not in encrypted format.
String newpassword = “super12”;
AccessManager accessManager = new AccessManager();
int returnValue = accessManager.changepassword (loginName,password,newpassword)
 
 

resetPassword

Reset passwords for the given login names.

 

Signature:

        int resetPassword(String []loginName)

 

Parameters:

loginName – String array of loginName

 

Returns:

1 on success , 0 on failure

 

Sample Usage:
String loginNames[] = {“superUser”,”kioskoperator”};
AccessManager accessManager = new AccessManager();
int returnValue = accessManager.changepassword(loginNames);

 

getLoggedInUsers

This method returns the users who are currently logged in for a given user type.

 

Signature:

        Map getLoggedInUsers(int userType)
 

Parameters:

userType – User type

Returns:

            java.util.Map – Key – loginName, Value – java.util.List containing only one item,login time.       

Sample Usage:
int userType = 1;
AccessManager accessManager = new AccessManager();
Map loggedInUser = accessManager. getLoggedInUsers (userType);

 

Get GSi at SourceForge.net. Fast, secure and Free Open Source software downloads
©2004-2009 Comat Technologies Pvt. Ltd.