-
Notifications
You must be signed in to change notification settings - Fork 250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support KRB5 tokens in Negotiate headers #281
Conversation
Add to the existing request context.
Add support for Authorization headers with KRB5 token.
Update http.go
Had to close and re-open the PR since the previous CI timed out. |
Hi @shanmugh, thanks for your contribution, however I don't think this is the right approach. I think when unmarshalling bytes into an SPNEGOToken those bytes should be of that type rather then taking the bytes of a KRB5Token and converting them into an SPNEGOToken. I'm not sure that this is the root cause of the issue in #278. You mention in #278 that curl sends a KRB5Token. Can you send me the command you are using. When I have looked at curl before it is still wrapping the KRB5Token in an SPNEGOToken on the client side before sending to the server so this should work. If it is sending a KRB5Token without wrapping in SPNEGO then it is not doing SPNEGO auth but something else. Thanks. |
You are correct, I misquoted the issue in #278. Here is some additional information regarding the curl interaction that appears to be sending a KRB5 token. I am afraid the default Centos7 curl version does not support SPNEGO token out of the box.
I am happy to redo the patch if you can point out the correct approach. Thanks for the feedback. |
@@ -139,6 +139,15 @@ func (s *SPNEGOToken) Unmarshal(b []byte) error { | |||
if err != nil { | |||
return fmt.Errorf("not a valid SPNEGO token: %v", err) | |||
} | |||
// If OID is a KRB5 OID, wrap in a SPNEGO token | |||
if oid.Equal(gssapi.OID(gssapi.OIDKRB5)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need to check for both the OIDKRB5
and the OIDLegacyKRB5
. These seem to be interchangeable with Windows Server 2016
As was discussed in this issue (#278) it is currently not possible to authenticate using a KRB5 token. After some investigating of the token formats, it looks like the KRB5 data can be embedded into a SPNEGOToken to complete the authentication. This will be a huge benefit for clients which are still generating tokens with KRB5 MechType OID.
@jcmturner Please let me know if this a viable solution for supporting KRB5 token in the library.