aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/MainModule.java
diff options
context:
space:
mode:
authorDan <djr2468@gmail.com>2023-04-01 17:08:55 +0100
committerDan <djr2468@gmail.com>2023-04-01 17:08:55 +0100
commit1edce2477fde4ef8b626cf51ea175f86f63dd308 (patch)
treebd81c35038ac7ea2d0cc601b03d4919e7021ee7e /src/main/java/org/traccar/MainModule.java
parent21ccdb1234407fb17f7b96245fb7aab770fa3cbd (diff)
downloadtrackermap-server-1edce2477fde4ef8b626cf51ea175f86f63dd308.tar.gz
trackermap-server-1edce2477fde4ef8b626cf51ea175f86f63dd308.tar.bz2
trackermap-server-1edce2477fde4ef8b626cf51ea175f86f63dd308.zip
Create OIDC class and add provider to MainModule
Diffstat (limited to 'src/main/java/org/traccar/MainModule.java')
-rw-r--r--src/main/java/org/traccar/MainModule.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/MainModule.java b/src/main/java/org/traccar/MainModule.java
index 663747de1..417844f50 100644
--- a/src/main/java/org/traccar/MainModule.java
+++ b/src/main/java/org/traccar/MainModule.java
@@ -87,6 +87,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.OpenIDProvider;
import javax.annotation.Nullable;
import javax.inject.Singleton;
@@ -169,6 +170,15 @@ public class MainModule extends AbstractModule {
}
return null;
}
+
+ @Singleton
+ @Provides
+ public static OpenIDProvider provideOpenIDProvider(Config config) {
+ if (config.getBoolean(Keys.OIDC_ENABLE)) {
+ return new OpenIDProvider(config);
+ }
+ return null;
+ }
@Provides
public static WebServer provideWebServer(Injector injector, Config config) {