モジュール java.base
パッケージ javax.security.auth

クラスAuthPermission

  • すべての実装されたインタフェース:
    Serializable, Guard

    public final class AuthPermission
    extends BasicPermission
    このクラスは、認証のアクセス権に関連します。 AuthPermissionには名前(「ターゲット名」とも呼ばれる)は含まれますが、アクション・リストは含まれません。名前付きアクセス権を得るか、得ないかのどちらかになります。

    ターゲット名には、セキュリティ構成パラメータの名前(下記を参照)を指定します。 現在、SubjectLoginContextおよびConfigurationオブジェクトへのアクセスをガードするには、AuthPermissionオブジェクトを使用します。

    認証権限の標準ターゲット名は、次のとおりです。

          doAs -                  allow the caller to invoke the
                                  Subject.doAs methods.
    
          doAsPrivileged -        allow the caller to invoke the
                                  Subject.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
                                  a SubjectDomainCombiner.
    
          setReadOnly -           allow the caller to set a Subject
                                  to be read-only.
    
          modifyPrincipals -      allow the caller to modify the Set
                                  of Principals associated with a
                                  Subject
    
          modifyPublicCredentials - allow the caller to modify the
                                  Set of public credentials
                                  associated with a Subject
    
          modifyPrivateCredentials - allow the caller to modify the
                                  Set of private credentials
                                  associated with a Subject
    
          refreshCredential -     allow code to invoke the refresh
                                  method on a credential which implements
                                  the Refreshable interface.
    
          destroyCredential -     allow code to invoke the destroy
                                  method on a credential object
                                  which implements the Destroyable
                                  interface.
    
          createLoginContext.{name} -  allow code to instantiate a
                                  LoginContext with the
                                  specified name.  name
                                  is used as the index into the installed login
                                  Configuration
                                  (that returned by
                                  Configuration.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 via
                                  Configuration.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

        public AuthPermission​(String name)
        指定された名前でAuthPermissionを新しく作成します。 名前は、AuthPermissionのシンボリック名です。
        パラメータ:
        name - AuthPermissionの名前
        例外:
        NullPointerException - namenullの場合。
        IllegalArgumentException - nameが空である場合。
      • AuthPermission

        public AuthPermission​(String name,
                              String actions)
        指定された名前でAuthPermissionオブジェクトを新しく作成します。 この名前はAuthPermissionのシンボリック名で、actionsのStringのactionsは現在使用されないためnullにする必要があります。
        パラメータ:
        name - AuthPermissionの名前
        actions - nullでなければならない。
        例外:
        NullPointerException - namenullの場合。
        IllegalArgumentException - nameが空である場合。