aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/model
diff options
context:
space:
mode:
authorDan <djr2468@gmail.com>2023-04-01 23:10:18 +0100
committerDan <djr2468@gmail.com>2023-04-01 23:10:18 +0100
commit040fa7c83b67b0c6541348c4ecd3979c7a80ebc5 (patch)
tree54e126c501feb0639b50a21ec5be1558b03174c5 /src/main/java/org/traccar/model
parent21abf0f8479c48d8b826dd861f8c1227e6a00e25 (diff)
downloadtrackermap-server-040fa7c83b67b0c6541348c4ecd3979c7a80ebc5.tar.gz
trackermap-server-040fa7c83b67b0c6541348c4ecd3979c7a80ebc5.tar.bz2
trackermap-server-040fa7c83b67b0c6541348c4ecd3979c7a80ebc5.zip
Expose OIDC state on /server endpoint
Diffstat (limited to 'src/main/java/org/traccar/model')
-rw-r--r--src/main/java/org/traccar/model/Server.java16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/model/Server.java b/src/main/java/org/traccar/model/Server.java
index 73645721b..4c6e10b5e 100644
--- a/src/main/java/org/traccar/model/Server.java
+++ b/src/main/java/org/traccar/model/Server.java
@@ -16,13 +16,16 @@
package org.traccar.model;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+
+import org.traccar.Main;
+import org.traccar.api.security.OpenIDProvider;
import org.traccar.storage.QueryIgnore;
import org.traccar.storage.StorageName;
@StorageName("tc_servers")
@JsonIgnoreProperties(ignoreUnknown = true)
public class Server extends ExtendedModel implements UserRestrictions {
-
+
private boolean registration;
public boolean getRegistration() {
@@ -261,4 +264,15 @@ public class Server extends ExtendedModel implements UserRestrictions {
this.newServer = newServer;
}
+ @QueryIgnore
+ public boolean getOidcEnabled() {
+ OpenIDProvider oidc = Main.getInjector().getInstance(OpenIDProvider.class);
+ return oidc != null;
+ }
+
+ @QueryIgnore
+ public boolean getOidcForce() {
+ OpenIDProvider oidc = Main.getInjector().getInstance(OpenIDProvider.class);
+ return oidc != null && oidc.force;
+ }
}