AuthN: Login (#61225)

* AuthN: Add function to login auth request
This commit is contained in:
Karl Persson
2023-01-10 14:55:27 +01:00
committed by GitHub
parent ef9a71f483
commit 2de72c1c39
5 changed files with 132 additions and 11 deletions
+4 -2
View File
@@ -34,10 +34,12 @@ type ClientParams struct {
type PostAuthHookFn func(ctx context.Context, identity *Identity, r *Request) error
type Service interface {
// RegisterPostAuthHook registers a hook that is called after a successful authentication.
RegisterPostAuthHook(hook PostAuthHookFn)
// Authenticate authenticates a request using the specified client.
Authenticate(ctx context.Context, client string, r *Request) (*Identity, bool, error)
// Login authenticates a request and creates a session on successful authentication.
Login(ctx context.Context, client string, r *Request) (*Identity, error)
// RegisterPostAuthHook registers a hook that is called after a successful authentication.
RegisterPostAuthHook(hook PostAuthHookFn)
}
type Client interface {