diff --git a/cmd/server/handler_connection_factory.go b/cmd/server/handler_connection_factory.go index bfa65c0fb1b..cc6da823ce7 100644 --- a/cmd/server/handler_connection_factory.go +++ b/cmd/server/handler_connection_factory.go @@ -23,10 +23,10 @@ func newConnectionHandler(c *config.Config, router *httprouter.Router) *connecti h.Manager = connection.NewMemoryManager() break case *config.RethinkDBConnection: - con.CreateTableIfNotExists("hydra_policies") + con.CreateTableIfNotExists("hydra_connections") m := &connection.RethinkManager{ Session: con.GetSession(), - Table: r.Table("hydra_policies"), + Table: r.Table("hydra_connections"), } if err := m.ColdStart(); err != nil { logrus.Fatalf("Could not fetch initial state: %s", err) diff --git a/cmd/token_user.go b/cmd/token_user.go index 96fa48842d3..4fec15eef84 100644 --- a/cmd/token_user.go +++ b/cmd/token_user.go @@ -29,6 +29,7 @@ var tokenUserCmd = &cobra.Command{ }}) } + scopes, _ := cmd.Flags().GetStringSlice("scopes") conf := oauth2.Config{ ClientID: c.ClientID, ClientSecret: c.ClientSecret, @@ -36,7 +37,7 @@ var tokenUserCmd = &cobra.Command{ TokenURL: pkg.JoinURLStrings(c.ClusterURL, "/oauth2/token"), AuthURL: pkg.JoinURLStrings(c.ClusterURL, "/oauth2/auth"), }, - Scopes: []string{"core", "hydra", "offline", "openid"}, + Scopes: scopes, } state, err := sequence.RuneSequence(24, []rune("abcdefghijklmnopqrstuvwxyz")) @@ -106,4 +107,5 @@ var tokenUserCmd = &cobra.Command{ func init() { tokenCmd.AddCommand(tokenUserCmd) tokenUserCmd.Flags().Bool("no-open", false, "Do not open a browser window with the authorize url") + tokenUserCmd.Flags().StringSlice("scopes", []string{"core", "hydra", "offline", "openid"}, "Ask for specific scopes") } diff --git a/sdk/client.go b/sdk/client.go index db77e004339..9c3f6facd7b 100644 --- a/sdk/client.go +++ b/sdk/client.go @@ -111,7 +111,8 @@ func Connect(opts ...option) (*Client, error) { } c.Warden = &warden.HTTPWarden{ - Client: c.http, + Client: c.http, + Endpoint: c.clusterURL, } return c, nil