java.lang.Object
java.security.Permission
java.security.BasicPermission
javax.security.auth.AuthPermission
- 所有已实现的接口:
Serializable
,Guard
此类用于身份验证权限。
AuthPermission
包含名称(也称为“目标名称”)但没有操作列表;您要么拥有命名权限,要么没有。
目标名称是安全配置参数的名称(见下文)。目前,AuthPermission
对象用于保护对 Subject
、LoginContext
和 Configuration
对象的访问。
身份验证权限的标准目标名称是:
doAs - allow the caller to invoke theSubject.doAs
methods. doAsPrivileged - allow the caller to invoke theSubject.doAsPrivileged
methods. getSubject - allow for the retrieval of the Subject(s) associated with the current Thread. getSubjectFromDomainCombiner - allow for the retrieval of the Subject associated with the aSubjectDomainCombiner
. setReadOnly - allow the caller to set a Subject to be read-only. modifyPrincipals - allow the caller to modify theSet
of Principals associated with aSubject
modifyPublicCredentials - allow the caller to modify theSet
of public credentials associated with aSubject
modifyPrivateCredentials - allow the caller to modify theSet
of private credentials associated with aSubject
refreshCredential - allow code to invoke therefresh
method on a credential which implements theRefreshable
interface. destroyCredential - allow code to invoke thedestroy
method on a credentialobject
which implements theDestroyable
interface. createLoginContext.{name} - allow code to instantiate aLoginContext
with the specifiedname
.name
is used as the index into the installed loginConfiguration
(that returned byConfiguration.getConfiguration()
). name can be wildcarded (set to '*') to allow for any name. getLoginConfiguration - allow for the retrieval of the system-wide login Configuration. createLoginConfiguration.{type} - allow code to obtain a Configuration object viaConfiguration.getInstance
. setLoginConfiguration - allow for the setting of the system-wide login Configuration. refreshLoginConfiguration - allow for the refreshing of the system-wide login Configuration.
请注意,使用“modifyPrincipals”、“modifyPublicCredentials”或“modifyPrivateCredentials”目标授予此权限允许 JAAS 登录模块将主体或凭证对象填充到主题中。尽管读取私有凭据集内的信息需要授予PrivateCredentialPermission
凭据类型,但读取主体集和公共凭据集内的信息不需要额外的权限。这些对象可能包含潜在的敏感信息。例如,读取本地用户信息或执行 Kerberos 登录的登录模块能够将用户 ID、组和域名等潜在敏感信息添加到主体集中。
以下目标名称已被弃用,取而代之的是 createLoginContext.{name}
。
createLoginContext - allow code to instantiate a
LoginContext
.
- 实现注意事项:
- 实现可以定义额外的目标名称,但应使用命名约定(例如反向域名表示法)以避免名称冲突。
- 自从:
- 1.4
- 参见:
-
构造方法总结
构造方法构造方法描述AuthPermission
(String name) 创建具有指定名称的新 AuthPermission。AuthPermission
(String name, String actions) 创建具有指定名称的新 AuthPermission 对象。 -
方法总结
在类 java.security.BasicPermission 中声明的方法
equals, getActions, hashCode, implies, newPermissionCollection
在类 java.security.Permission 中声明的方法
checkGuard, getName, toString
-
构造方法详细信息
-
AuthPermission
创建具有指定名称的新 AuthPermission。该名称是 AuthPermission 的符号名称。- 参数:
name
- AuthPermission 的名称- 抛出:
NullPointerException
- 如果name
是null
。IllegalArgumentException
- 如果name
为空。
-
AuthPermission
创建具有指定名称的新 AuthPermission 对象。 name 是 AuthPermission 的符号名称,actions String 当前未使用,应为 null。- 参数:
name
- AuthPermission 的名称actions
- 应该为空。- 抛出:
NullPointerException
- 如果name
是null
。IllegalArgumentException
- 如果name
为空。
-