labstack / echox

Echo cookbook and website
https://echo.labstack.com
MIT License
408 stars 285 forks source link

Add note about only supporting HTTP basic auth #160

Closed jrobchin closed 3 years ago

lammel commented 3 years ago

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
}

Thanks @jrobchin. Merging.