AuthPermission — 인증 권한

AuthPermission — 인증 권한

AuthPermission은 인증과 관련된 권한을 나타내는 클래스예요. 안에 이름(또는 "target name"이라고도 불러요)만 있고 동작(actions) 목록은 없어요. 즉 이름이 지정한 권한을 가졌거나, 그렇지 않거나 둘 중 하나예요. target name은 보안 구성 파라미터의 이름이에요.

출처: Java API Reference

본문

public final class AuthPermission extends BasicPermission

현재 AuthPermission 객체는 Subject, LoginContext, Configuration 객체에 대한 접근을 보호(guard)하는 데 사용돼요.

표준 target name

인증 권한의 표준 target name은 다음과 같아요.

  • doAs — 호출자가 Subject.doAs 메서드를 호출할 수 있게 해줘요.
  • doAsPrivileged — 호출자가 Subject.doAsPrivileged 메서드를 호출할 수 있게 해줘요.
  • getSubject — 현재 Thread에 연관된 Subject를 조회할 수 있게 해줘요.
  • getSubjectFromDomainCombinerSubjectDomainCombiner에 연관된 Subject를 조회할 수 있게 해줘요.
  • setReadOnly — 호출자가 Subject를 읽기 전용으로 설정할 수 있게 해줘요.
  • modifyPrincipals — 호출자가 Subject에 연관된 Set of Principals를 수정할 수 있게 해줘요.
  • modifyPublicCredentials — 호출자가 Subject에 연관된 공개 자격 증명(credential) 집합을 수정할 수 있게 해줘요.
  • modifyPrivateCredentials — 호출자가 Subject에 연관된 비공개 자격 증명 집합을 수정할 수 있게 해줘요.
  • refreshCredentialRefreshable 인터페이스를 구현하는 자격 증명의 refresh 메서드를 호출할 수 있게 해줘요.
  • destroyCredentialDestroyable 인터페이스를 구현하는 자격 증명 객체의 destroy 메서드를 호출할 수 있게 해줘요.
  • createLoginContext.{name} — 지정된 name으로 LoginContext를 인스턴스화할 수 있게 해줘요. name은 설치된 로그인 Configuration(즉 Configuration.getConfiguration()이 반환하는 것)의 인덱스로 사용돼요. name은 와일드카드('*')로 설정해 어떤 이름이든 허용할 수 있어요.
  • getLoginConfiguration — 시스템 전체 로그인 Configuration을 조회할 수 있게 해줘요.
  • createLoginConfiguration.{type}Configuration.getInstance를 통해 Configuration 객체를 얻을 수 있게 해줘요.
  • setLoginConfiguration — 시스템 전체 로그인 Configuration을 설정할 수 있게 해줘요.
  • refreshLoginConfiguration — 시스템 전체 로그인 Configuration을 새로고침할 수 있게 해줘요.

modifyPrincipals, modifyPublicCredentials, modifyPrivateCredentials target으로 이 권한을 부여하면 JAAS 로그인 모듈이 Subject에 principal이나 credential 객체를 넣을 수 있어요. 정보를 읽는 것은 허용하지만 수정은 허용하지 않는 것보다는 엄격한 보안 제어가 필요할 수 있어요.

더 알아보기 (Learn more)