diff --git a/server/auth/microsoft/microsoft.go b/server/auth/microsoft/microsoft.go
index fc0a60c728333b09397714be83eed1d1d0ed3eff..11528b99be170d401a75bc0c7d45dbd932db2fec 100644
--- a/server/auth/microsoft/microsoft.go
+++ b/server/auth/microsoft/microsoft.go
@@ -5,7 +5,7 @@ import (
"net/http"
"strings"
- "github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac"
+ //"github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac"
"github.com/nsheridan/cashier/server/auth"
"github.com/nsheridan/cashier/server/config"
"github.com/nsheridan/cashier/server/metrics"
@@ -44,6 +44,7 @@ func New(c *config.Auth) (*Config, error) {
ClientSecret: c.OauthClientSecret,
RedirectURL: c.OauthCallbackURL,
Endpoint: microsoft.AzureADEndpoint(c.ProviderOpts["tenant"]),
+ Scopes: []string{"openid", "profile", "email"},
},
tenant: c.ProviderOpts["tenant"],
whitelist: uw,
diff --git a/server/server.go b/server/server.go
index 97b3c6376adee1750c242d981cc1f7d7d1bcad3a..c990b1767e627b24428d72cddab9f74fe1e11535 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"
@@ -88,12 +89,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)
}