I am in doubt if it is possible to use Waffle to obtain a ticket to specific Service (token). I can use GSS-API to obtain a Service ticket but I am interested if that is possible to do with Waffle. I have followed this discussion http://waffle.codeplex.com/discussions/267276 but I am not sure if that is possible to have the actual ticket. The scenario is the following: I have my Waffle client setup with Kerberos, I took Waffle JAAS client from here http://waffle.codeplex.com/workitem/11248. So I can login and get the IWindowsIdentety which presumably have TGT for my user, then I need to use this TGT to get a ticket to specific service (my service) so my user can be automatically logged in. Currently we use GSS-API for that and GSS function org.ietf.jgss.GSSContext.initSecContext but it is not enough for us because of some security restrictions it fails in some specific scenario. I know that Waffle uses SSPI and can call impersonate() on the server side to imitate the client currently logged in user, but I don't see how can I use that to get the Service token.
public byte[] getServiceTicketSSPI(final String serviceName) {
final String securityPackage = "Kerberos";
IWindowsCredentialsHandle clientCredentials = null;
WindowsSecurityContextImpl clientContext = null;
final String currentUser = WindowsAccountImpl.getCurrentUsername();
try {
clientCredentials = WindowsCredentialsHandleImpl.getCurrent(currentUser, securityPackage);
clientCredentials.initialize();
// initial client security context
clientContext = new WindowsSecurityContextImpl();
clientContext.setPrincipalName(currentUser);
clientContext.setCredentialsHandle(clientCredentials.getHandle());
clientContext.setSecurityPackage(securityPackage);
final SecBufferDesc continueToken = null;
do {
clientContext.initialize(clientContext.getHandle(), continueToken, serviceName);
} while (clientContext.getContinue());
return clientContext.getToken();
} finally {
if (clientContext != null) {
clientContext.dispose();
}
if (clientCredentials != null) {
clientCredentials.dispose();
}
}
}
--
You received this message because you are subscribed to the Google Groups "waffle" group.
To unsubscribe from this group and stop receiving emails from it, send an email to waffle-users...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.