kerby icon indicating copy to clipboard operation
kerby copied to clipboard

Checking status after KerbServer.Step

Open JLofgren opened this issue 8 years ago • 1 comments

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().

JLofgren avatar May 30 '17 13:05 JLofgren

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.

aebruno avatar May 31 '17 14:05 aebruno