How to pass kerberos ticket at api level?

Hi,

Am relatively new in the domain of Java Security, JAAS and JGSS. After reading the tutorials and examples, I was able to do authentication and message transfer using Kerberos LoginModule. All the examples demonstrates message transfer and credential passing at socket level.

But in normal scenario's a server application exposes its APIs and the clients invokes remote methods on the server instead of sending data at a socket level.

My question is can I use kerberos and JGSS to pass security context at api level without adding an arguement for security context in each api call?

In simple terms, Is it possible to implicitly pass user credential's to server at each api call instead of exchanging/encrypting data at socket level?

Is there any other mechanism that meets this kind of requirement?

Thanks,

Kapil

[868 byte] By [kapilgupta77a] at [2008-1-28]
# 1
Using JAAS and GSS is to authinticate your logged in information against LDAP, this is the way to authinticate against windows login.in a simple way by using JAAS + GSS you are authinticating against the current logged in information used i.e by windows credintial against LDAP.
Eaglesa at 2007-7-14 > top of java,Security,Kerberos & Java GSS (JGSS)...
# 2
and this is the way it works if you want to use kerberos ticket you have to use JAAS + GSS to authinticate to your current logging information which you passed under your OS level i.e windows
Eaglesa at 2007-7-14 > top of java,Security,Kerberos & Java GSS (JGSS)...
# 3
I agree that I have to use JAAS and JGSS to authenticate via kerberos mechanism but my question was how this can be realized without establishing context by exchanging message at socket level. Regards,Kapil
kapilgupta77a at 2007-7-14 > top of java,Security,Kerberos & Java GSS (JGSS)...
# 4
Seema, could you please help me on this?Thanks,Kapil
kapilgupta77a at 2007-7-14 > top of java,Security,Kerberos & Java GSS (JGSS)...
# 5
You mean you do not want by each remote call establish context by calling:GSSContext.initSecContext()GSSContext.acceptSecContext()
yurtsevicha at 2007-7-14 > top of java,Security,Kerberos & Java GSS (JGSS)...
# 6

If you need to pass Kerberos credentials to the server, you need to

delegate credentials.

Ensure you have a valid forwardable TGT, enable delegation at the client-end.

context.requestCredDeleg(true);

At the server-end you can obtained delegated credential after GSS context

has been established.

context.getDelegCred();

Seema

Seema-1a at 2007-7-14 > top of java,Security,Kerberos & Java GSS (JGSS)...
# 7

Seema, could you please elaborate on how GSS context is established?

The examples show that context is established after series of message passing between client and server inside a while loop

while (!peerContext.isEstablished()) {

byteToken = peerContext.initSecContext(byteToken, 0, byteToken.length);

if (byteToken != null) {

outStream.writeInt(byteToken.length);

outStream.write(byteToken );

outStream.flush();

}//if

if (!peerContext.isEstablished()) {

byteToken = new byte[inStream.readInt()];

inStream.readFully(byteToken );

}//if

}//while (!peerContext...)

Is there any other way to establish GSS context ?

Thanks & Regards,

Kapil

kapilgupta77a at 2007-7-14 > top of java,Security,Kerberos & Java GSS (JGSS)...
# 8

The GSS client and server do need to exchange tokens in order to establish a

security context, as per the GSSAPI specification. This is required to achieve

successful authentication.

GSSAPI generates tokens, it's the application's responsibility to send the tokens

to the peer. Application can decide how to send the tokens to the peer.

You can refer to RFC 2853 for details.

Seema

Seema-1a at 2007-7-14 > top of java,Security,Kerberos & Java GSS (JGSS)...
# 9
kapilgupta77, you need to investigate your application protocol/API for a means to do this transparently. For example, in CORBA, custom hooks (interceptors) can be installed to transparently attach a credential to a method invocation. The same is true for Axis (handlers).
aaronrha at 2007-7-14 > top of java,Security,Kerberos & Java GSS (JGSS)...