https://github.com/flamego/auth
Package auth is a middleware that provides request authentication for Flamego
https://github.com/flamego/auth
basic-authentication bearer-authentication flamego go middleware
Last synced: about 1 month ago
JSON representation
Package auth is a middleware that provides request authentication for Flamego
- Host: GitHub
- URL: https://github.com/flamego/auth
- Owner: flamego
- License: mit
- Created: 2021-08-28T06:01:25.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-08-03T19:32:38.000Z (7 months ago)
- Last Synced: 2025-08-03T21:21:29.907Z (7 months ago)
- Topics: basic-authentication, bearer-authentication, flamego, go, middleware
- Language: Go
- Homepage:
- Size: 64.5 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# auth
[](https://github.com/flamego/auth/actions?query=workflow%3AGo)
[](https://pkg.go.dev/github.com/flamego/auth?tab=doc)
Package auth is a middleware that provides request authentication for [Flamego](https://github.com/flamego/flamego).
## Installation
```zsh
go get github.com/flamego/auth
```
## Getting started
```go
package main
import (
"github.com/flamego/auth"
"github.com/flamego/flamego"
)
func main() {
f := flamego.Classic()
f.Use(auth.Basic("username", "secretpassword"))
f.Get("/", func(user auth.User) string {
return "Welcome, " + string(user)
})
f.Run()
}
```
## Getting help
- Read [documentation and examples](https://flamego.dev/middleware/auth.html).
- Please [file an issue](https://github.com/flamego/flamego/issues) or [start a discussion](https://github.com/flamego/flamego/discussions) on the [flamego/flamego](https://github.com/flamego/flamego) repository.
## License
This project is under the MIT License. See the [LICENSE](LICENSE) file for the full license text.