mirror of
https://github.com/wso2/open-mcp-auth-proxy.git
synced 2025-06-27 17:13:31 +00:00
add --asgardeo
This commit is contained in:
parent
9f5fc69fb6
commit
06f0aeb461
3 changed files with 18 additions and 3 deletions
|
@ -17,6 +17,7 @@ import (
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
demoMode := flag.Bool("demo", false, "Use Asgardeo-based provider (demo).")
|
demoMode := flag.Bool("demo", false, "Use Asgardeo-based provider (demo).")
|
||||||
|
asgardeoMode := flag.Bool("asgardeo", false, "Use Asgardeo-based provider (demo).")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
// 1. Load config
|
// 1. Load config
|
||||||
|
@ -32,8 +33,10 @@ func main() {
|
||||||
cfg.JWKSURL = "https://api.asgardeo.io/t/" + cfg.Demo.OrgName + "/oauth2/jwks"
|
cfg.JWKSURL = "https://api.asgardeo.io/t/" + cfg.Demo.OrgName + "/oauth2/jwks"
|
||||||
provider = authz.NewAsgardeoProvider(cfg)
|
provider = authz.NewAsgardeoProvider(cfg)
|
||||||
fmt.Println("Using Asgardeo provider (demo).")
|
fmt.Println("Using Asgardeo provider (demo).")
|
||||||
} else {
|
} else if *asgardeoMode {
|
||||||
log.Fatalf("Not supported yet.")
|
cfg.AuthServerBaseURL = "https://api.asgardeo.io/t/" + cfg.Asgardeo.OrgName + "/oauth2"
|
||||||
|
cfg.JWKSURL = "https://api.asgardeo.io/t/" + cfg.Asgardeo.OrgName + "/oauth2/jwks"
|
||||||
|
provider = authz.NewAsgardeoProvider(cfg)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3. (Optional) Fetch JWKS if you want local JWT validation
|
// 3. (Optional) Fetch JWKS if you want local JWT validation
|
||||||
|
|
|
@ -16,3 +16,8 @@ demo:
|
||||||
org_name: "openmcpauthdemo"
|
org_name: "openmcpauthdemo"
|
||||||
client_id: "N0U9e_NNGr9mP_0fPnPfPI0a6twa"
|
client_id: "N0U9e_NNGr9mP_0fPnPfPI0a6twa"
|
||||||
client_secret: "qFHfiBp5gNGAO9zV4YPnDofBzzfInatfUbHyPZvM0jka"
|
client_secret: "qFHfiBp5gNGAO9zV4YPnDofBzzfInatfUbHyPZvM0jka"
|
||||||
|
|
||||||
|
asgardeo:
|
||||||
|
org_name: "<org_name>"
|
||||||
|
client_id: "<client_id>"
|
||||||
|
client_secret: "<client_secret>"
|
||||||
|
|
|
@ -13,6 +13,12 @@ type DemoConfig struct {
|
||||||
OrgName string `yaml:"org_name"`
|
OrgName string `yaml:"org_name"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type AsgardeoConfig struct {
|
||||||
|
ClientID string `yaml:"client_id"`
|
||||||
|
ClientSecret string `yaml:"client_secret"`
|
||||||
|
OrgName string `yaml:"org_name"`
|
||||||
|
}
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
AuthServerBaseURL string `yaml:"auth_server_base_url"`
|
AuthServerBaseURL string `yaml:"auth_server_base_url"`
|
||||||
MCPServerBaseURL string `yaml:"mcp_server_base_url"`
|
MCPServerBaseURL string `yaml:"mcp_server_base_url"`
|
||||||
|
@ -23,7 +29,8 @@ type Config struct {
|
||||||
PathMapping map[string]string `yaml:"path_mapping"`
|
PathMapping map[string]string `yaml:"path_mapping"`
|
||||||
|
|
||||||
// Nested config for Asgardeo
|
// Nested config for Asgardeo
|
||||||
Demo DemoConfig `yaml:"demo"`
|
Demo DemoConfig `yaml:"demo"`
|
||||||
|
Asgardeo AsgardeoConfig `yaml:"asgardeo"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// LoadConfig reads a YAML config file into Config struct.
|
// LoadConfig reads a YAML config file into Config struct.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue