Support silent login from HTTP basic authentication.

This commit is contained in:
Yang Luo
2021-09-21 22:57:37 +08:00
parent ea8017dd4b
commit 964b60da29

View File

@ -49,8 +49,12 @@ func denyRequest(ctx *context.Context) {
}
func getUsernameByClientIdSecret(ctx *context.Context) string {
clientId := ctx.Input.Query("clientId")
clientSecret := ctx.Input.Query("clientSecret")
clientId, clientSecret, ok := ctx.Request.BasicAuth()
if !ok {
clientId = ctx.Input.Query("clientId")
clientSecret = ctx.Input.Query("clientSecret")
}
if clientId == "" || clientSecret == "" {
return ""
}