PINsafe client DLL How To Guide

From Swivel Knowledgebase
Revision as of 16:24, 19 March 2010 by Gfield (talk)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


PINsafe client DLL How To Guide

Overview

The PINsafe client DLL is used by various PINsafe applications to integrate PINsafe. A strongly signed version is available.

Settings

By default, it assumes that it reads its settings from the executable application settings. The fields it requires are:

  • PINsafeServer - the name or IP of the PINsafe server
  • PINsafePort - the port number on which to access PINsafe (usually 8080)
  • PINsafeContext - the PINsafe application context (usually pinsafe)
  • PINsafeSecure - "true" or "false" for https or http
  • PINsafeSecret - the Agent shared secret
  • PINsafeAcceptSelfSigned - set to "true" to avoid problems with SSL certificates

Optional settings are:

  • PINsafeCookieSecret - used to encrypt the authentication cookie
  • PINsafeIdleTimeSecs - timeout for the authentication cookie

If you are configuring the client as above, just create a default instance of the PINsafe client:

  • PINsafeClient client = new PINsafeClient();

If you prefer to configure it manually, then create a PINsafeSettings instance:

  • PINsafeSettings settings = new PINsafeSettings(false);

Set the properties for Server, Port, Context, Secret, Ssl, AcceptSelfSigned, CookieSecret and IdleTimeSecs.

Then create a new client as follows:

  • PINsafeClient client = new PINsafeClient(settings);

Methods

The main methods you might need are:

bool UserExists(string username) - check if a user exists in PINsafe

string StartSession(string username) - start a PINsafe single-channel session

Image GetImage(String sessionID, String username, out int status) - get a security

string image: either sessionID or username can be given (the other should be null) Image GetMessage(String sessionID, String Username, out int status) - request an on-demand dual channel security string. The image is simply a confirmation image.

bool Login(string username, string password, string OTC) - authenticate a user

string LoginCookie(string username, string password, string otc, DateTime expiryTime) -login and return a secure cookie if successful.

bool CookieValid(string cookieData) - check if a PINsafe authentication cookie is valid.

bool ChangePin(string username, string password, string newPassword, string OTC, string newOTC) - Change the user's PIN

bool RequestResetCode(string username) - request a self-reset code for a user

bool Reset(string username, string resetCode) - perform a user self-reset