I followed the wiki on authentication to build this and tested it working. It wasn't hard to implement yourself, but password authentication seems like the most common use case most people will need, so this makes it slightly easier to get started.
I've combined client and server handling here as the most common use case is using Unity for everything, but this class can also be used on stand-alone non-Unity servers without changes. Seeing as clients only (appear to) need AcceptChallenge, it may be interesting to split IUserAuthenticator into a server and a client counterpart in the future.
Open question: do we need a timing-safe string comparison for security reasons? I did a quick search, but .NET does not appear to have this built-in, though I may have missed it.
This adds a simple password user authenticator.
I followed the wiki on authentication to build this and tested it working. It wasn't hard to implement yourself, but password authentication seems like the most common use case most people will need, so this makes it slightly easier to get started.
I've combined client and server handling here as the most common use case is using Unity for everything, but this class can also be used on stand-alone non-Unity servers without changes. Seeing as clients only (appear to) need
AcceptChallenge
, it may be interesting to splitIUserAuthenticator
into a server and a client counterpart in the future.Open question: do we need a timing-safe string comparison for security reasons? I did a quick search, but .NET does not appear to have this built-in, though I may have missed it.