i have some questions on using keytab for Authentication hope the kind people here can enlightend me
Say, i have userA who is going to use a service running at port 1010. First, userA will login to Active Directory to authenticate himself.
After login, userA will try to connect to the server to use its service 1010. In order for the server to verify that UserA is who he is, I need to use setspn
to register SPN at the Active Directory. eg
setspn -s service1010/mydomain.com serviceaccount1
Then need to generate ktab file at Active directory, eg
ktab -a serviceprincal1010/server.domain.com@DOMAIN.COM -k mykeytab.keytab
and then bring mykeytab.keytab
to the server.
At the server, I would use JAAS with a login config to query the KDC eg
ServicePrincipalLoginContext
{
com.sun.security.auth.module.Krb5LoginModule required
principal=serviceprincal1010/server.domain.com@DOMAIN.COM
doNotPrompt=true useKeyTab=true keyTab=mykeytab.keytab storeKey=true;
};
From this point on, I am confused. How does userA get verified (ie, userA is actually who he is? ).