core/databroker: disable identity manager user refresh when hosted authenticate is used (#4905)

This commit is contained in:
Caleb Doxsey 2024-01-12 13:30:03 -07:00 committed by GitHub
parent 1080a33443
commit 5e0079c649
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 1 deletions

View file

@ -160,13 +160,15 @@ func (c *DataBroker) update(ctx context.Context, cfg *config.Config) error {
manager.WithEventManager(c.eventsMgr),
}
if cfg.Options.Provider != "" {
if cfg.Options.SupportsUserRefresh() {
authenticator, err := identity.NewAuthenticator(oauthOptions)
if err != nil {
log.Error(ctx).Err(err).Msg("databroker: failed to create authenticator")
} else {
options = append(options, manager.WithAuthenticator(authenticator))
}
} else {
log.Info(ctx).Msg("databroker: disabling refresh of user sessions")
}
if c.manager == nil {