mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-03 20:50:19 +08:00
Support silent login from HTTP basic authentication.
This commit is contained in:
@ -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 ""
|
||||
}
|
||||
|
Reference in New Issue
Block a user