Telogis.GeoBase.Authenticator |
Used to provide authentication services with GeoStream servers using only JavaScript. Necessary when providing GeoStream authentication from non .NET environments or services.
Name | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
getAuthToken (Object config) | Used to asynchronously retrieve an authentication token for a GeoStream server. Username and password must match with a username and password on the server (set in GeoBase.setService: 'users.Config' configuration file). JavaScript function main() { Telogis.GeoBase.Authenticator.getAuthToken({ server: "http://domain.com/geostream/", username: "myUsername", password: "myPassword", expiry: 600, // duration in seconds: ten minutes success: function(authInfo){ GeoBase.setAuthToken(authInfo.token); alert("Authentication successful" + "\n\nThe 32-character string representing this token is: " + authInfo.token + "\n\nThis token will expire in: " + Math.round(authInfo.expiry / 1000) + " seconds" + "\n\nThe IP mask this token is valid for is: " + authInfo.mask); }, error: function(){ alert("Failed to authenticate"); } }); // The tasks that require authentication to proceed }
authToken - The authentication token, and an object containing authentication information returned by the server (authInfo). This object contains the token ('token') as a 32-character string representing the GUID, the length of time in milliseconds that the token is valid for ('expiry') from the time of the token's creation, and the IP bit mask that this token is valid for ('mask') as a string. |