1
0
mirror of https://github.com/smallstep/cli.git synced 2025-08-09 03:22:43 +03:00

Remove condition to use Google OOB

This commit is contained in:
Mariano Cano
2022-11-09 16:06:50 -08:00
parent 69d478ae27
commit 4c3f5f9600

View File

@@ -185,11 +185,7 @@ $ step oauth --client-id my-client-id --client-secret my-client-secret \
cli.BoolFlag{ cli.BoolFlag{
Name: "console, c", Name: "console, c",
Usage: `Complete the flow while remaining only inside the terminal. Usage: `Complete the flow while remaining only inside the terminal.
This flag defaults to use the Device Authorization Grant flow.`,
NOTE: This flag will continue to use the Out of Band (OOB) flow for Google OAuth clients
until Oct 3, 2022 when the OOB flow will be shut off. All other OAuth clients
will default to using the Device Authorization Grant flow
(https://datatracker.ietf.org/doc/html/rfc8628#section-3.2).`,
}, },
cli.StringFlag{ cli.StringFlag{
Name: "console-flow", Name: "console-flow",
@@ -385,15 +381,9 @@ func oauthCmd(c *cli.Context) error {
case c.IsSet("console-flow"): case c.IsSet("console-flow"):
return errs.InvalidFlagValue(c, "console-flow", consoleFlowInput, "device, oob") return errs.InvalidFlagValue(c, "console-flow", consoleFlowInput, "device, oob")
case c.Bool("console"): case c.Bool("console"):
oobDeprecationDate := time.Date(2022, time.October, 3, 0, 0, 0, 0, time.UTC)
if time.Now().Before(oobDeprecationDate) && (opts.Provider == "google" || strings.HasPrefix(opts.Provider, "https://accounts.google.com")) {
isOOBFlow = true
opts.ConsoleFlow = oobConsoleFlow
} else {
isDeviceFlow = true isDeviceFlow = true
opts.ConsoleFlow = deviceConsoleFlow opts.ConsoleFlow = deviceConsoleFlow
} }
}
var clientID, clientSecret string var clientID, clientSecret string
switch { switch {