public class Credential
extends java.lang.Object
SuperMap的安全证书类,其中包括token等安全验证信息。
当服务器开启安全认证之后,所有有权限的用户可以通过自己的用户名以及密码在服务列表界面申请自己唯一的安全锁,通过安全锁信息创建一个安全证书对象,将其存放于Credential的静态字段CREDENTIAL里, 当用户发送服务请求时,会自动通过CREDENTIAL字段获取相应的信息组合之后访问服务器,如果不设置有效的安全证书将无法访问受安全限制的服务。
限定符和类型 | 字段和说明 |
---|---|
static Credential |
CREDENTIAL
用于存储安全证书对象,如果用户的服务器开启了安全认证,用户必须设置此属性才能访问相关的服务。
|
java.lang.String |
name
验证信息前缀,name=value部分的name部分,默认为“token”。
|
java.lang.String |
value
访问受安全限制的服务时用于通过安全认证的验证信息。
|
构造器和说明 |
---|
Credential(java.lang.String value)
构造函数。
|
Credential(java.lang.String name, java.lang.String value)
构造函数。
|
限定符和类型 | 方法和说明 |
---|---|
void |
destroy() |
public static volatile Credential CREDENTIAL
用于存储安全证书对象,如果用户的服务器开启了安全认证,用户必须设置此属性才能访问相关的服务。目前支持的服务包括:地图服务、数据服务、专题图、量算、查询、公交换乘、空间分析、网络分析。
需要使用用户名和密码在:”http://localhost:8090/iserver/services/security/tokens”下申请value 获得形如:”2OMwGmcNlrP2ixqv1Mk4BuQMybOGfLOrljruX6VcYMDQKc58Sl9nMHsqQaqeBx44jRvKSjkmpZKK1L596y7skQ..”的value
public java.lang.String name
验证信息前缀,name=value部分的name部分,默认为“token”。
public java.lang.String value
访问受安全限制的服务时用于通过安全认证的验证信息。