Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the get-tokens command #55

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions internal/cli/apis.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
}