kerby
kerby copied to clipboard
Checking status after KerbServer.Step
Taking KerbServer.UserName as an example, the comments say:
// Get the user name of the principal trying to authenticate to the server.
// This method must only be called after KerbServer.Step returns a complete or
// continue response code.
What is the proper way to check the response code from KerbServer.Step?
This is also needed in general to check whether the gssapi context has been established properly. It seems that perhaps the Step function should be returning the result of C.authenticate_gss_server_step().
What is the proper way to check the response code from KerbServer.Step?
Something like this should be sufficent:
err = kc.Step("")
if err != nil {
// handle error
}
KerbServer.Step returns an error if the step failed. The underlying C function should only ever return AUTH_GSS_ERROR or AUTH_GSS_COMPLETE. I will update the docs to make this more clear. Thanks for pointing this out.