alexbrainman / sspi

Windows SSPI
BSD 3-Clause "New" or "Revised" License
84 stars 27 forks source link

'The token supplied to the function is invalid' in ClientContext Update() #16

Open Gamment opened 3 months ago

Gamment commented 3 months ago

The ClientContext Update() method accepts some 'token'. I presume it should be the one that's returned from NewClientContext() method as 'outputToken'. However, when I do pass the 'outputToken' to the Update() method it throws the 'The token supplied to the function is invalid' error. What would be the correct input 'token' for the Update() method, how should the user prepare such a correct 'token'?

alexbrainman commented 3 months ago

The ClientContext Update() method accepts some 'token'. I presume it should be the one that's returned from NewClientContext() method as 'outputToken'. However, when I do pass the 'outputToken' to the Update() method it throws the 'The token supplied to the function is invalid' error. What would be the correct input 'token' for the Update() method,

Your description matches how this code was supposed to be used.

how should the user prepare such a correct 'token'?

I would use this https://github.com/alexbrainman/sspi/blob/1a75b4708caa219fd8d8261cd37c923ff6710a32/negotiate/negotiate_test.go as an example. Make sure you check for errors in your code, and match the semantics of SSPI API.

Alex