OAuth2Strategy interface to abstract the details of the login flow

This allows implementing clients the deviate from the standard OAuth2 flow
This commit is contained in:
Philipp Wolfer 2023-11-23 14:41:31 +01:00
parent 780af98e1e
commit f447a259d4
No known key found for this signature in database
GPG key ID: 8FDF744D4919943B
6 changed files with 130 additions and 27 deletions

View file

@ -21,6 +21,7 @@ import (
"time"
"github.com/spf13/viper"
"go.uploadedlobster.com/scotty/internal/auth"
"golang.org/x/oauth2"
)
@ -87,7 +88,7 @@ type OAuth2Authenticator interface {
Backend
// Returns OAuth2 config suitable for this backend
OAuth2Config(redirectUrl *url.URL) oauth2.Config
OAuth2Strategy(redirectUrl *url.URL) auth.OAuth2Strategy
// Setup the OAuth2 client
OAuth2Setup(token oauth2.TokenSource) error