mirror of
https://github.com/davidallendj/opaal.git
synced 2025-12-20 03:27:02 -07:00
Fixed login file name and added to .gitignore
This commit is contained in:
parent
4cf5af58fc
commit
bfcbca9cf1
2 changed files with 23 additions and 12 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1 +1,2 @@
|
||||||
*.json
|
*.json
|
||||||
|
**oidc**
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,17 @@
|
||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import "github.com/spf13/cobra"
|
import (
|
||||||
|
"davidallendj/oidc-auth/internal/oauth"
|
||||||
|
"davidallendj/oidc-auth/internal/oidc"
|
||||||
|
"davidallendj/oidc-auth/internal/server"
|
||||||
|
"davidallendj/oidc-auth/internal/util"
|
||||||
|
"errors"
|
||||||
|
"fmt"
|
||||||
|
"net/http"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
host string
|
host string
|
||||||
|
|
@ -14,7 +25,7 @@ var (
|
||||||
|
|
||||||
var loginCmd = &cobra.Command{
|
var loginCmd = &cobra.Command{
|
||||||
Use: "login",
|
Use: "login",
|
||||||
Short: "Start the login flow"
|
Short: "Start the login flow",
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
oidcProvider := oidc.NewOIDCProvider()
|
oidcProvider := oidc.NewOIDCProvider()
|
||||||
var authorizationUrl = util.BuildAuthorizationUrl(
|
var authorizationUrl = util.BuildAuthorizationUrl(
|
||||||
|
|
@ -49,14 +60,13 @@ var loginCmd = &cobra.Command{
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
func init(){
|
|
||||||
loginCmd.Flags().StringVar(&client.Id, "client.id", "", "set the client ID")
|
loginCmd.Flags().StringVar(&client.Id, "client.id", "", "set the client ID")
|
||||||
loginCmd.Flags().StringVar(&redirectUri, "redirect-uri", "", "set the redirect URI")
|
loginCmd.Flags().StringSliceVar(&redirectUri, "redirect-uri", []string{""}, "set the redirect URI")
|
||||||
loginCmd.Flags().StringVar(&responseType, "response-type", "code", "set the response-type")
|
loginCmd.Flags().StringVar(&responseType, "response-type", "code", "set the response-type")
|
||||||
loginCmd.Flags().StringSliceVar(&scope, "scope", []string{"openid", "email"}, "set the scopes")
|
loginCmd.Flags().StringSliceVar(&scope, "scope", []string{"openid", "email"}, "set the scopes")
|
||||||
loginCmd.Flags().String(&state, "state", util.RandomString(), "set the state")
|
loginCmd.Flags().StringVar(&state, "state", util.RandomString(20), "set the state")
|
||||||
loginCmd.Flags().StringVar(host, "host", "127.0.0.1", "set the listening host")
|
loginCmd.Flags().StringVar(&host, "host", "127.0.0.1", "set the listening host")
|
||||||
loginCmd.Flags().IntVar(&port, "port", 3333, "set the listening port")
|
loginCmd.Flags().IntVar(&port, "port", 3333, "set the listening port")
|
||||||
rootCmd.AddCommand(loginCmd)
|
rootCmd.AddCommand(loginCmd)
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue