Im trying to create a application that can authenticate a user using kerberos ticket. I dont know how can i proceed with this. i have wrote some code to get spengo token from header and then extract the kerberos token from it. but i receive only a null spengo token. im running my application on the same server that the active directory is set up.
here is the method that im using to get spnego token
private byte[] getSPNEGOTokenFromHTTPRequest(HttpServletRequest req) {
byte[] spnegoToken = null;
if (req != null) {
String header = req.getHeader("Authorization");
if ((header != null) && header.startsWith("Negotiate")) {
header = header.substring("Negotiate".length()).trim();
try {
spnegoToken = Base64.decode(header);
} catch (Exception e) {
e.printStackTrace();
//todo
}
}
}
return spnegoToken;
}
Can any one help me with this or tell me what im doing wrong here