Requirement is to do a kerberos login when user is on network and domain joined machine and fallback to form based authentication otherwise.
We are able to achieve the kerberos login without any issues and in case of fallback we are getting windows pop-up which we want to remove , Any help is appreciated.
Below is the snippet of code:
try{
String auth = request.getHeader("Authorization");
if (auth == null){
response.setStatus(response.SC_UNAUTHORIZED);
response.setHeader("WWW-Authenticate", "NEGOTIATE");
response.flushBuffer();
//return;
}
if (auth != null && auth.startsWith("Negotiate")){
redirectURL = kerberosRedirectURL;
}
else {
if (orginalTarget != null) {
orginalTarget = orginalTarget.replaceAll("-SM-", "");
orginalTarget = orginalTarget.replaceAll("--", "-");
formProtectURL = formProtectURL + "?&ORIGINALTARGET=" + orginalTarget;
redirectURL = formProtectURL;
}
}