|
static String | serializeCredential (KerberosTicket kerberosTicket, GSSCredential gssCredential) throws KerberosSerializationException |
|
static GSSCredential | deserializeCredential (String serializedCred) throws KerberosSerializationException |
|
|
static String | serialize (Serializable obj) throws IOException |
|
static Object | deserialize (String serialized) throws ClassNotFoundException, IOException |
|
Provides serialization/deserialization of kerberos org.ietf.jgss.GSSCredential, so it can be transmitted from auth-server to the application and used for further calls to kerberos-secured services
- 著者
- Marek Posolda
◆ KerberosSerializationUtils()
org.keycloak.common.util.KerberosSerializationUtils.KerberosSerializationUtils |
( |
| ) |
|
|
inlineprivate |
◆ [static initializer]()
org.keycloak.common.util.KerberosSerializationUtils.[static initializer] |
( |
| ) |
|
|
inlinestaticpackage |
◆ deserialize()
static Object org.keycloak.common.util.KerberosSerializationUtils.deserialize |
( |
String |
serialized | ) |
throws ClassNotFoundException, IOException |
|
inlinestaticprivate |
110 byte[] bytes = Base64.decode(serialized);
111 ByteArrayInputStream bis =
new ByteArrayInputStream(bytes);
112 ObjectInput in = null;
114 in =
new ObjectInputStream(bis);
115 return in.readObject();
121 }
catch (IOException ex) {
122 ex.printStackTrace();
◆ deserializeCredential()
static GSSCredential org.keycloak.common.util.KerberosSerializationUtils.deserializeCredential |
( |
String |
serializedCred | ) |
throws KerberosSerializationException |
|
inlinestatic |
69 if (serializedCred == null) {
70 throw new KerberosSerializationException(
"Null credential given as input. Did you enable kerberos credential delegation for your web browser and mapping of gss credential to access token?");
74 Object deserializedCred =
deserialize(serializedCred);
75 if (!(deserializedCred instanceof KerberosTicket)) {
76 throw new KerberosSerializationException(
"Deserialized object is not KerberosTicket! Type is: " + deserializedCred);
79 KerberosTicket ticket = (KerberosTicket) deserializedCred;
81 return KerberosJdkProvider.getProvider().kerberosTicketToGSSCredential(ticket);
82 }
catch (KerberosSerializationException ke) {
84 }
catch (Exception ioe) {
85 throw new KerberosSerializationException(
"Unexpected exception when deserialize GSSCredential", ioe);
static Object deserialize(String serialized)
Definition: KerberosSerializationUtils.java:109
◆ serialize()
static String org.keycloak.common.util.KerberosSerializationUtils.serialize |
( |
Serializable |
obj | ) |
throws IOException |
|
inlinestaticprivate |
91 ByteArrayOutputStream bos =
new ByteArrayOutputStream();
92 ObjectOutput out = null;
94 out =
new ObjectOutputStream(bos);
96 byte[] objBytes = bos.toByteArray();
97 return Base64.encodeBytes(objBytes);
103 }
catch (IOException ex) {
104 ex.printStackTrace();
◆ serializeCredential()
static String org.keycloak.common.util.KerberosSerializationUtils.serializeCredential |
( |
KerberosTicket |
kerberosTicket, |
|
|
GSSCredential |
gssCredential |
|
) |
| throws KerberosSerializationException |
|
inlinestatic |
55 if (gssCredential == null) {
56 throw new KerberosSerializationException(
"Null credential given as input");
59 kerberosTicket = KerberosJdkProvider.getProvider().gssCredentialToKerberosTicket(kerberosTicket, gssCredential);
62 }
catch (IOException e) {
63 throw new KerberosSerializationException(
"Unexpected exception when serialize GSSCredential", e);
static String serialize(Serializable obj)
Definition: KerberosSerializationUtils.java:90
◆ JAVA_INFO
final String org.keycloak.common.util.KerberosSerializationUtils.JAVA_INFO |
|
static |
このクラス詳解は次のファイルから抽出されました: