Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAuthStackCfg ¶
func GetAuthStackCfg() (kratosSDK.Configuration, hydraSDK.TransportConfig, hydraSDK.TransportConfig)
GetAuthStackCfg read config file at then return clients to interact Kratos public, Hydra public, Hydra admin.
Types ¶
type Config ¶
type Config struct { Env string `json:"env"` BaseURL string `json:"baseUrl"` Kratos KratosConfig `json:"kratos"` Hydra HydraConfig `json:"hydra"` Log LogConfig `json:"log"` }
var Cfg Config
func (Config) GetBrowserAuthCodeURL ¶
GetBrowserAuthCodeURL generate authentication URL from Hydra client config This URL is used to init AuthZ code login flow. Docs: https://www.ory.sh/hydra/docs/concepts/login/ In case we have a list of callback URLs, this function will use the first URL in the array.
func (*Config) GetHydraOauth2Config ¶
func (h *Config) GetHydraOauth2Config() *hydraModels.OAuth2Client
GetHydraOauth2Config take config from file then return *hydraModels.OAuth2Client Currently, we use this result to register an Oauth2 client in Hydra.
func (*Config) GetInternalHydraOAuth2Config ¶
GetInternalHydraOAuth2Config is used to export oauth2 config for internal purpose, for example: exchange token. In case we have a list of callback URLs, this function will use the first URL in the array.
type HydraClient ¶
type HydraConfig ¶
type HydraConfig struct { BrowserURL string `json:"browserURL"` Public HydraTransportConfig `json:"public"` Admin HydraTransportConfig `json:"admin"` Client HydraClient `json:"client"` }