mirror of
https://git.sr.ht/~phw/scotty
synced 2025-04-30 13:47:05 +02:00
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:
parent
780af98e1e
commit
f447a259d4
6 changed files with 130 additions and 27 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue