Skip to content
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

Krberror hides original error #437

Open
lorenz opened this issue Apr 18, 2021 · 2 comments · May be fixed by #440
Open

Krberror hides original error #437

lorenz opened this issue Apr 18, 2021 · 2 comments · May be fixed by #440

Comments

@lorenz
Copy link

lorenz commented Apr 18, 2021

When requesting a TGT with Kerberos the client.ASExchange() function returns a krberror.Krberror which provides no way to access the original ErrorCode. This makes it very brittle to depend on Kerberos error codes (for example to detect KDC_ERR_KEY_EXPIRED).

@lorenz lorenz linked a pull request May 14, 2021 that will close this issue
@jcmturner
Copy link
Owner

I have been working on improving the krberror package so that is uses error wrapping. Once this is implemented then you should be able to...

var target messages.KRBError
errors.As(err, &target)
ecode := target.ErrorCode

Would this be suitable?

@lorenz
Copy link
Author

lorenz commented Aug 7, 2022

This is what my code already looks like, so this would be perfect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants