From 6b02fc8ac2b8dc753b00ec97d319b4afb385258f Mon Sep 17 00:00:00 2001 From: xer0x Date: Tue, 26 Jan 2021 14:34:29 -0800 Subject: [PATCH] Add the get-tokens command --- internal/cli/apis.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/internal/cli/apis.go b/internal/cli/apis.go index e7198a9bc..3dbd901a0 100644 --- a/internal/cli/apis.go +++ b/internal/cli/apis.go @@ -18,6 +18,7 @@ func apisCmd(cli *cli) *cobra.Command { cmd.AddCommand(createApiCmd(cli)) cmd.AddCommand(updateApiCmd(cli)) cmd.AddCommand(deleteApiCmd(cli)) + cmd.AddCommand(getTokenApiCmd(cli)) return cmd } @@ -165,3 +166,28 @@ auth0 apis delete --id id return cmd } + +func getTokenApiCmd(cli *cli) *cobra.Command { + var flags struct { + id string + } + + cmd := &cobra.Command{ + Use: "get-token", + Short: "Get a user token", + Long: `Get a user token for an API: + +auth0 apis get-token --audience url +`, + RunE: func(cmd *cobra.Command, args []string) error { + + return nil + }, + } + + cmd.Flags().StringVarP(&flags.id, "audience", "a", "", "Audience URL") + + mustRequireFlags(cmd, "audience") + + return cmd +}