diff --git a/internal/session/auth.go b/internal/session/auth.go index 9ccfa4ea..49c5fd68 100644 --- a/internal/session/auth.go +++ b/internal/session/auth.go @@ -8,7 +8,7 @@ import ( ) func (manager *SessionManagerCtx) Authenticate(r *http.Request) (types.Session, error) { - id, secret, ok := r.BasicAuth() + id, secret, ok := getAuthData(r) if !ok { return nil, fmt.Errorf("no authentication provided") } @@ -24,3 +24,19 @@ func (manager *SessionManagerCtx) Authenticate(r *http.Request) (types.Session, return session, nil } + +func getAuthData(r *http.Request) (string, string, bool) { + id, secret, ok := r.BasicAuth() + if ok { + return id, secret, true + } + + id = r.URL.Query().Get("id") + secret = r.URL.Query().Get("secret") + + if id != "" && secret != "" { + return id, secret, true + } + + return "", "", false +} \ No newline at end of file