mirror of
https://github.com/bolkedebruin/rdpgw.git
synced 2025-08-15 13:23:46 +02:00
Support for NTLM authentication added (#109)
* Support for NTLM authentication added To support NTLM authentication, a database is added as an authentication source. Currently, only the configuration file is supported as a database. Database authentication supports Basic and NTLM authentication protcols. ServerConfig.BasicAuthEnabled renamed to LocalEnabled as Basic auth can be used with NTLM or Local.
This commit is contained in:
parent
7472c7b2c1
commit
372dc43ef2
16 changed files with 947 additions and 64 deletions
25
cmd/auth/database/config.go
Executable file
25
cmd/auth/database/config.go
Executable file
|
@ -0,0 +1,25 @@
|
|||
package database
|
||||
|
||||
import (
|
||||
"github.com/bolkedebruin/rdpgw/cmd/auth/config"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
users map[string]config.UserConfig
|
||||
}
|
||||
|
||||
func NewConfig(users []config.UserConfig) *Config {
|
||||
usersMap := map[string]config.UserConfig{}
|
||||
|
||||
for _, user := range users {
|
||||
usersMap[user.Username] = user
|
||||
}
|
||||
|
||||
return &Config{
|
||||
users: usersMap,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Config) GetPassword (username string) string {
|
||||
return c.users[username].Password
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue