@@ -74,6 +74,7 @@ func connect(auth bool) *vault.Vault {
74
74
fmt .Fprintf (os .Stderr , "@R{You are not authenticated to a Vault.}\n " )
75
75
fmt .Fprintf (os .Stderr , "Try @C{safe auth ldap}\n " )
76
76
fmt .Fprintf (os .Stderr , " or @C{safe auth github}\n " )
77
+ fmt .Fprintf (os .Stderr , " or @C{safe auth okta}\n " )
77
78
fmt .Fprintf (os .Stderr , " or @C{safe auth token}\n " )
78
79
fmt .Fprintf (os .Stderr , " or @C{safe auth userpass}\n " )
79
80
fmt .Fprintf (os .Stderr , " or @C{safe auth approle}\n " )
@@ -546,7 +547,7 @@ provided multiple times to provide multiple CA certificates.
546
547
fmt .Fprintf (os .Stderr , "You will need to target a Vault manually first.\n \n " )
547
548
fmt .Fprintf (os .Stderr , "Try something like this:\n " )
548
549
fmt .Fprintf (os .Stderr , " @C{safe target ops https://address.of.your.vault}\n " )
549
- fmt .Fprintf (os .Stderr , " @C{safe auth (github|token|ldap|userpass)}\n " )
550
+ fmt .Fprintf (os .Stderr , " @C{safe auth (github|token|ldap|okta| userpass)}\n " )
550
551
fmt .Fprintf (os .Stderr , "\n " )
551
552
os .Exit (1 )
552
553
}
@@ -1427,7 +1428,7 @@ written to STDOUT instead of STDERR to make it easier to consume.
1427
1428
1428
1429
r .Dispatch ("auth" , & Help {
1429
1430
Summary : "Authenticate to the current target" ,
1430
- Usage : "safe auth [--path <value>] (token|github|ldap|userpass|approle)" ,
1431
+ Usage : "safe auth [--path <value>] (token|github|ldap|okta| userpass|approle)" ,
1431
1432
Description : `
1432
1433
Set the authentication token sent when talking to the Vault.
1433
1434
@@ -1436,6 +1437,7 @@ Supported auth backends are:
1436
1437
token Set the Vault authentication token directly.
1437
1438
github Provide a Github personal access (oauth) token.
1438
1439
ldap Provide LDAP user credentials.
1440
+ okta Provide Okta user credentials.
1439
1441
userpass Provide a username and password registered with the UserPass backend.
1440
1442
approle Provide a client ID and client secret registered with the AppRole backend.
1441
1443
status Get information about current authentication status
@@ -1490,6 +1492,16 @@ Flags:
1490
1492
}
1491
1493
token = result .ClientToken
1492
1494
1495
+ case "okta" :
1496
+ username := prompt .Normal ("Okta username: " )
1497
+ password := prompt .Secure ("Password: " )
1498
+
1499
+ result , err := v .Client ().Client .AuthOktaMount (authMount , username , password )
1500
+ if err != nil {
1501
+ return err
1502
+ }
1503
+ token = result .ClientToken
1504
+
1493
1505
case "github" :
1494
1506
accessToken := prompt .Secure ("Github Personal Access Token: " )
1495
1507
0 commit comments