3
0

Ability to provision OIDC w/o full redir-url verification

This commit is contained in:
Denis Arh
2019-07-18 05:45:22 +02:00
parent 0e1575f90f
commit 2586919c6b
4 changed files with 13 additions and 10 deletions
+9 -1
View File
@@ -105,7 +105,15 @@ func oidcAutoDiscovery(ctx context.Context, cmd *cobra.Command, c *cli.Config) (
for p := 0; p < plen; p = p + 2 {
name, purl = providers[p], providers[p+1]
eap, err = external.RegisterOidcProvider(ctx, name, purl, false, true, true)
// force: false
// because we do not want to override the provider every time the system restarts
//
// validate: false
// because at the initial (empty db) start, we can not actually validate (server is not yet up)
//
// enable: true
// we want provider & the entire external auth to be validated
eap, err = external.RegisterOidcProvider(ctx, name, purl, false, false, true)
if err != nil {
c.Log.Error(
-6
View File
@@ -197,9 +197,3 @@ func Settings(ctx context.Context, c *cli.Config) *cobra.Command {
return cmd
}
func SettingsAutoConfigure(cmd *cobra.Command) {
// @todo load
// autoDiscoverAuthSettings()
// @todo store
}
+4
View File
@@ -69,6 +69,10 @@ func RegisterOidcProvider(ctx context.Context, name, providerUrl string, force,
}
}
if as.ExternalRedirectUrl == "" {
return nil, errors.New("refusing to register oidc privider withoit redirect url")
}
p, err := parseExternalProviderUrl(providerUrl)
if err != nil {
return
-3
View File
@@ -58,9 +58,6 @@ func Configure() *cli.Config {
cli.HandleError(discoverSettings(ctx, cmd, c))
cli.HandleError(oidcAutoDiscovery(ctx, cmd, c))
// Run auto configuration
commands.SettingsAutoConfigure(cmd)
// Reload auto-configured settings
service.DefaultAuthSettings, _ = service.DefaultSettings.LoadAuthSettings()
}