The current implementation of the Casbin middleware does indeed onyl allow retrieving the username via basic auth. So adding a note is helpful here.
From labstack/echo-contrib/casbin/casbin.go:
// GetUserName gets the user name from the request.
// Currently, only HTTP basic authentication is supported
func (a *Config) GetUserName(c echo.Context) string {
username, _, _ := c.Request().BasicAuth()
return username
}
The current implementation of the Casbin middleware does indeed onyl allow retrieving the username via basic auth. So adding a note is helpful here.
From
labstack/echo-contrib/casbin/casbin.go
:Thanks @jrobchin. Merging.