Class: Credential

SuperMap.Credential

SuperMap Credential class,which includes the security verification information like token.
Apply the user name and password in:"http://localhost:8090/iserver/services/security/tokens".
The value is like: "2OMwGmcNlrP2ixqv1Mk4BuQMybOGfLOrljruX6VcYMDQKc58Sl9nMHsqQaqeBx44jRvKSjkmpZKK1L596y7skQ.."
Supported functions include: map service, thematic maps, measure, query, transportation transfer, spatial analysis, network analysis. Polling function is not supported.

new SuperMap.Credential(value, name)

Credential.js, line 3
Name Type Default Description
value string

Verification information which is used to pass the safety verification when user visits the services that is subject to security restrictions.

name string 'token' optional

Prefix of verification information, the name part in the name=value part, and the default is "token".

Example
var pixcel = new SuperMap.Credential("valueString","token");
pixcel.destroy();

Members

(static, constant) SuperMap.Credential.CREDENTIALSuperMap.Credential

This object stores an instance of a Credential class, which must be set up when the server needs the security verification.

Example
// When iServer enables the security certificate, the following code is needed. The Credential class can receive a value and a name.
 var value = "(take iServer as example, it is the applied token value here)";
 var name = "token";
 // The name parameter is token by default, so it doesn't need to be set up when using the iServer service.
 SuperMap.Credential.CREDENTIAL = new SuperMap.Credential(value, name);

Methods

destroy()

Credential.js, line 62

Destroy the object. All properties of the object will be null after it is destroyed.

Example
var credential = new SuperMap.Credential("valueString","token");
credential.destroy();

getUrlParameters(){string}

Credential.js, line 35
Returns:
Type Description
string Returns the value string which is the token value under the iServer service.
Example
var credential = new SuperMap.Credential("valueString","token");
// str = "token=valueString";
var str = credential.getUrlParameters();