new SuperMap.Credential(value, name)
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();