diff options
author | Dan <djr2468@gmail.com> | 2023-04-01 23:10:18 +0100 |
---|---|---|
committer | Dan <djr2468@gmail.com> | 2023-04-01 23:10:18 +0100 |
commit | 040fa7c83b67b0c6541348c4ecd3979c7a80ebc5 (patch) | |
tree | 54e126c501feb0639b50a21ec5be1558b03174c5 /src/main/java/org/traccar/model | |
parent | 21abf0f8479c48d8b826dd861f8c1227e6a00e25 (diff) | |
download | trackermap-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.java | 16 |
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; + } } |