@@ -74,6 +74,7 @@ import (
7474 "github.com/smartcontractkit/chainlink/v2/core/sessions"
7575 "github.com/smartcontractkit/chainlink/v2/core/sessions/ldapauth"
7676 "github.com/smartcontractkit/chainlink/v2/core/sessions/localauth"
77+ "github.com/smartcontractkit/chainlink/v2/core/sessions/oidcauth"
7778 "github.com/smartcontractkit/chainlink/v2/core/static"
7879 "github.com/smartcontractkit/chainlink/v2/plugins"
7980)
@@ -351,7 +352,7 @@ func NewApplication(opts ApplicationOpts) (Application, error) {
351352 localAdminUsersORM := localauth .NewORM (opts .DS , cfg .WebServer ().SessionTimeout ().Duration (), globalLogger , auditLogger )
352353
353354 // Initialize Sessions ORM based on environment configured authenticator
354- // localDB auth or remote LDAP auth
355+ // localDB auth, LDAP auth, or OIDC auth
355356 authMethod := cfg .WebServer ().AuthenticationMethod ()
356357 var authenticationProvider sessions.AuthenticationProvider
357358 var sessionReaper * utils.SleeperTask
@@ -365,7 +366,16 @@ func NewApplication(opts ApplicationOpts) (Application, error) {
365366 if err != nil {
366367 return nil , errors .Wrap (err , "NewApplication: failed to initialize LDAP Authentication module" )
367368 }
368- sessionReaper = ldapauth .NewLDAPServerStateSync (opts .DS , cfg .WebServer ().LDAP (), globalLogger )
369+ sessionReaper = ldapauth .NewLDAPServerStateSync (opts .DS , cfg .Database (), cfg .WebServer ().LDAP (), globalLogger )
370+ case sessions .OIDCAuth :
371+ var err error
372+ authenticationProvider , err = oidcauth .NewOIDCAuthenticator (
373+ opts .DS , cfg .Database (), cfg .WebServer ().OIDC (), globalLogger , auditLogger ,
374+ )
375+ if err != nil {
376+ return nil , errors .Wrap (err , "NewApplication: failed to initialize OIDC Authentication module" )
377+ }
378+ sessionReaper = oidcauth .NewSessionReaper (opts .DS , cfg .WebServer (), globalLogger )
369379 case sessions .LocalAuth :
370380 authenticationProvider = localauth .NewORM (opts .DS , cfg .WebServer ().SessionTimeout ().Duration (), globalLogger , auditLogger )
371381 sessionReaper = localauth .NewSessionReaper (opts .DS , cfg .WebServer (), globalLogger )
0 commit comments