aboutsummaryrefslogtreecommitdiff
path: root/server/auth/provider.go
diff options
context:
space:
mode:
Diffstat (limited to 'server/auth/provider.go')
-rw-r--r--server/auth/provider.go19
1 files changed, 1 insertions, 18 deletions
diff --git a/server/auth/provider.go b/server/auth/provider.go
index 06dc1c9..9d1c8bd 100644
--- a/server/auth/provider.go
+++ b/server/auth/provider.go
@@ -5,26 +5,9 @@ import "golang.org/x/oauth2"
// Provider is an abstraction of different auth methods.
type Provider interface {
Name() string
- StartSession(string) *Session
+ StartSession(string) string
Exchange(string) (*oauth2.Token, error)
Username(*oauth2.Token) string
Valid(*oauth2.Token) bool
Revoke(*oauth2.Token) error
}
-
-// Session stores authentication state.
-type Session struct {
- AuthURL string
- Token *oauth2.Token
-}
-
-// Authorize obtains data from the provider and retains an access token that
-// can be stored for later access.
-func (s *Session) Authorize(provider Provider, code string) error {
- t, err := provider.Exchange(code)
- if err != nil {
- return err
- }
- s.Token = t
- return nil
-}