简体   繁体   中英

Validating user credentials on Windows 10

Currently, I'm using the Security Support Provider Interface (SSPI) to validate user credentials, as described in this article from Mircrosoft: How to validate user credentials on Microsoft operating systems

This works generally well but I'm facing now an issue on a Windows 10 machine with the function AcceptSecurityContext (used when generating the server context in the SSPLogonUser method) returning error SEC_E_UNSUPPORTED_FUNCTION (0x80090302L).

Is there any alternative to validate user credentials on Windows 10 using Microsoft API?

That error is generated because one of the parameters accepted by AcceptSecurityContext, unsigned long fContextReq , was passed with the wrong value.

The values accepted are:

  • ASC_REQ_ALLOCATE_MEMORY
  • ASC_REQ_CONNECTION
  • ASC_REQ_DELEGATE
  • ASC_REQ_EXTENDED_ERROR
  • ASC_REQ_REPLAY_DETECT
  • ASC_REQ_SEQUENCE_DETECT
  • ASC_REQ_STREAM

The documentation link that you provide in your question says that not all clients may support the parameter passed therein.

It then proceeds saying here that not all flags are valid on a client and it suggests reading the post there carefully to understand what is available to you.

  1. Make sure you are passing valid values to begin with
  2. Check that the flag you are using can be used from a client and are not server-only

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM