java.io.Serializable, LoginCredentialspublic class KerberosCredentials extends java.lang.Object implements LoginCredentials, java.io.Serializable
This class provides a way for an application to authenticate as a particular Kerberos user when accessing a KVStore instance.
There are two approaches that client applications can use to authenticate
using Kerberos. Client applications that use the
Java Authentication and Authorization Service (JAAS) programming
framework can specify credentials by using the Subject.doAs(javax.security.auth.Subject, java.security.PrivilegedAction<T>) method.
Applications that do not use the JAAS framework can use this class to specify a Kerberos identity. The credentials of the specified user will be acquired from the Kerberos Key Distribution Center (KDC) based on the values specified for the KerberosCredentials instance.
| Constructor | Description |
|---|---|
KerberosCredentials(java.lang.String username,
java.util.Properties krbProperties) |
Creates Kerberos user credentials.
|
| Modifier and Type | Method | Description |
|---|---|---|
java.util.Properties |
getKrbProperties() |
Returns the Kerberos login properties.
|
java.lang.String |
getUsername() |
Identifies the user owning the credentials.
|
public KerberosCredentials(java.lang.String username,
java.util.Properties krbProperties)
throws java.lang.IllegalArgumentException
If, as recommended, each server host uses a different principal name
that includes an individual instance name, the KVSecurityConstants.AUTH_KRB_SERVICES_PROPERTY should specify the
mappings of server hostnames to Kerberos service principal names.
Users may need to provide Kerberos login properties so that underlying
authentication system can retrieve credentials from KDC. The properties
currently supported:
KVSecurityConstants.AUTH_KRB_CCACHE_PROPERTY
KVSecurityConstants.AUTH_KRB_KEYTAB_PROPERTY
KVSecurityConstants.AUTH_KRB_MUTUAL_PROPERTY
When multiple properties are set, for example,
KVSecurityConstants.AUTH_KRB_CCACHE_PROPERTY and
KVSecurityConstants.AUTH_KRB_KEYTAB_PROPERTY,
the underlying login service will retrieve credentials of this user in
following preference order:
username - the name of the userkrbProperties - the Kerberos login propertiesjava.lang.IllegalArgumentExceptionpublic java.lang.String getUsername()
LoginCredentialsgetUsername in interface LoginCredentialsLoginCredentials.getUsername()public java.util.Properties getKrbProperties()
Copyright (c) 2011, 2018 Oracle and/or its affiliates. All rights reserved.