2021-09-08 12:17:44 +02:00
|
|
|
package service
|
|
|
|
|
|
|
|
import (
|
|
|
|
"sync"
|
2021-09-08 14:41:28 +02:00
|
|
|
|
|
|
|
"github.com/photoprism/photoprism/internal/oidc"
|
2021-09-08 12:17:44 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
var onceOidc sync.Once
|
|
|
|
|
|
|
|
func initOidc() {
|
|
|
|
services.Oidc = oidc.NewClient(
|
|
|
|
Config().OidcIssuerUrl(),
|
|
|
|
Config().OidcClientId(),
|
|
|
|
Config().OidcClientSecret(),
|
|
|
|
Config().SiteUrl(),
|
2021-09-08 14:41:28 +02:00
|
|
|
Config().Debug(),
|
2021-09-08 12:17:44 +02:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
func Oidc() *oidc.Client {
|
|
|
|
onceOidc.Do(initOidc)
|
|
|
|
return services.Oidc
|
|
|
|
}
|