Skip to content

Latest commit

 

History

History
26 lines (20 loc) · 452 Bytes

basic.md

File metadata and controls

26 lines (20 loc) · 452 Bytes

Implement Basic Auth

  • Add basic auth middleware to dics/container.go
{
    Name:  "bima:middleware:basic-auth",
    Scope: bima.Application,
    Build: (*middlewares.BasicAuth)(nil),
    Params: dingo.Params{
        "Validator": func(username, password string) bool {
			return true
		},
    },
},

You need to implement Validator with your own logic

  • Add to configs/middlewares.yaml
middlewares:
    - basic-auth