quasoft / websspi

HTTP auth middleware for Go that uses Kerberos/NTLM SPNEGO with SSPI for single sign-on authentication of HTTP requests in Windows environments
MIT License
33 stars 7 forks source link

Add group resolution from security context. #3

Closed Varbin closed 3 years ago

Varbin commented 3 years ago

To use the "new" method, set Config.ServerName to an empty string when Config.EnumerateGroups is set; to continue asking another server set Config.ServerName to a valid server name.

Closes #1.

The set of groups returned from the new method are quite different from the old one, but should roughly return the same results as whoami /groups:

quasoft commented 3 years ago

Thanks for the contribution!

Will need some time to check it out.

quasoft commented 3 years ago

On second look it still looks pretty good. Thanks again for the excellent effort!

The token based enumeration is definitely the preferred way, so in a future major release will consider deprecating the ServerName config field and the GetUserGroups() func altogether.