diff options
author | Kevin Lyda <kevin@ie.suberic.net> | 2018-08-10 17:21:02 +0000 |
---|---|---|
committer | Niall Sheridan <nsheridan@gmail.com> | 2018-08-10 18:21:02 +0100 |
commit | 3e006c39b0a4411e91e80de261d0e7b5353d44c0 (patch) | |
tree | 57754a0a8b80200eede4d6e5a8c1ae7621a3f393 /server/server.go | |
parent | 99a01f63f51b73f103cd1e094f1a8e7f35d9d30b (diff) |
Add Microsoft auth provider
Microsoft uses JSON Web Tokens (JWT) as OAuth tokens. These can run to many thousands of characters which are too long for TTYs. Work around this by base64-encoding the token and chunk it into smaller pieces.
Closes #70
Diffstat (limited to 'server/server.go')
-rw-r--r-- | server/server.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/server/server.go b/server/server.go index 42476f3..1b8468e 100644 --- a/server/server.go +++ b/server/server.go @@ -16,6 +16,7 @@ import ( "github.com/nsheridan/cashier/server/auth/github" "github.com/nsheridan/cashier/server/auth/gitlab" "github.com/nsheridan/cashier/server/auth/google" + "github.com/nsheridan/cashier/server/auth/microsoft" "github.com/nsheridan/cashier/server/config" "github.com/nsheridan/cashier/server/metrics" "github.com/nsheridan/cashier/server/signer" @@ -90,12 +91,14 @@ func Run(conf *config.Config) { metrics.Register() switch conf.Auth.Provider { - case "google": - authprovider, err = google.New(conf.Auth) case "github": authprovider, err = github.New(conf.Auth) case "gitlab": authprovider, err = gitlab.New(conf.Auth) + case "google": + authprovider, err = google.New(conf.Auth) + case "microsoft": + authprovider, err = microsoft.New(conf.Auth) default: log.Fatalf("Unknown provider %s\n", conf.Auth.Provider) } |