aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/MainModule.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar/MainModule.java')
-rw-r--r--src/main/java/org/traccar/MainModule.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/MainModule.java b/src/main/java/org/traccar/MainModule.java
index 663747de1..51097511a 100644
--- a/src/main/java/org/traccar/MainModule.java
+++ b/src/main/java/org/traccar/MainModule.java
@@ -33,6 +33,7 @@ import org.traccar.broadcast.NullBroadcastService;
import org.traccar.config.Config;
import org.traccar.config.Keys;
import org.traccar.database.LdapProvider;
+import org.traccar.database.OpenIdProvider;
import org.traccar.database.StatisticsManager;
import org.traccar.forward.EventForwarder;
import org.traccar.forward.EventForwarderJson;
@@ -87,6 +88,7 @@ import org.traccar.storage.DatabaseStorage;
import org.traccar.storage.MemoryStorage;
import org.traccar.storage.Storage;
import org.traccar.web.WebServer;
+import org.traccar.api.security.LoginService;
import javax.annotation.Nullable;
import javax.inject.Singleton;
@@ -170,6 +172,15 @@ public class MainModule extends AbstractModule {
return null;
}
+ @Singleton
+ @Provides
+ public static OpenIdProvider provideOpenIDProvider(Config config, LoginService loginService) {
+ if (config.hasKey(Keys.OPENID_CLIENTID)) {
+ return new OpenIdProvider(config, loginService);
+ }
+ return null;
+ }
+
@Provides
public static WebServer provideWebServer(Injector injector, Config config) {
if (config.hasKey(Keys.WEB_PORT)) {