Brought rrig's implementation of kerberos delegation up to date with master

Made the changes as suggested here a8a6ada1c143e5b339480b3d509b456a619ffae3 and merged with master