Commit 93fe155d authored by Simon Schürg's avatar Simon Schürg 🚀
Browse files

Add LoginProfile

parent 96a7282c
......@@ -41,12 +41,34 @@ type refreshCredentials struct {
refreshToken string
}
// type LoginProfile struct {
// LoginType string
// Issuer string
// ClientID string
// Username string
// Password string
// // ClientSecret string
// }
type LoginProfile struct {
LoginType string `toml:"login_type"`
Issuer string `toml:"issuer"`
ClientID string `toml:"client_id"`
Username string `toml:"username"`
Password string `toml:"password"`
}
var loginCmd = &cobra.Command{
Use: "login",
Short: "Performs an OpenID Connect Login and retrieve tokens.",
Long: `Performs an OpenID Connect Login and retrieve two JWT - an access token and a refresh token.`,
Run: func(cmd *cobra.Command, args []string) {
if profile == "" {
if profile != "" {
// rawProfile := viper.Get(fmt.Sprintf("logins.%s", profile))
var profileBla LoginProfile
viper.UnmarshalKey(fmt.Sprintf("logins.%s", profile), profileBla)
fmt.Printf("%s", profileBla.ClientID)
fmt.Printf("The login command requires either a subcommand or the profile flag to be set.\n\n")
cmd.Help()
os.Exit(1)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment