Skip to content
Snippets Groups Projects
Commit 80a73b95 authored by Kevin Lyda's avatar Kevin Lyda :speech_balloon:
Browse files

Enable new auth provider; set scopes.

parent 3ac8ba07
No related branches found
No related tags found
No related merge requests found
......@@ -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,
......
......@@ -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)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment