Skip to content

Conversation

jrobchin
Copy link
Contributor

No description provided.

@lammel
Copy link
Contributor

lammel commented Dec 6, 2020

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.

@lammel lammel merged commit 10c581b into labstack:master Dec 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants