aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/api
diff options
context:
space:
mode:
authorDan <djr2468@gmail.com>2023-04-01 22:53:34 +0100
committerDan <djr2468@gmail.com>2023-04-01 22:53:34 +0100
commit21abf0f8479c48d8b826dd861f8c1227e6a00e25 (patch)
tree1062d5c078640140739b3f5915f9f3ced3bd9385 /src/main/java/org/traccar/api
parentb3840170a08a3ddbc070344c22e369aa08719a13 (diff)
downloadtrackermap-server-21abf0f8479c48d8b826dd861f8c1227e6a00e25.tar.gz
trackermap-server-21abf0f8479c48d8b826dd861f8c1227e6a00e25.tar.bz2
trackermap-server-21abf0f8479c48d8b826dd861f8c1227e6a00e25.zip
Throw API error if oidc disabled
Diffstat (limited to 'src/main/java/org/traccar/api')
-rw-r--r--src/main/java/org/traccar/api/resource/SessionResource.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/api/resource/SessionResource.java b/src/main/java/org/traccar/api/resource/SessionResource.java
index ca9f37667..515d7374a 100644
--- a/src/main/java/org/traccar/api/resource/SessionResource.java
+++ b/src/main/java/org/traccar/api/resource/SessionResource.java
@@ -169,6 +169,10 @@ public class SessionResource extends BaseResource {
@Path("openid/auth")
@GET
public Response openIdAuth() throws IOException {
+ if (openIdProvider == null) {
+ throw new WebApplicationException(Response.status(Response.Status.NOT_FOUND).build());
+ }
+
return Response.seeOther(
openIdProvider.createAuthRequest()
).build();
@@ -178,6 +182,10 @@ public class SessionResource extends BaseResource {
@Path("openid/callback")
@GET
public Response requestToken() throws IOException, StorageException {
+ if (openIdProvider == null) {
+ throw new WebApplicationException(Response.status(Response.Status.NOT_FOUND).build());
+ }
+
// Get full request URI
StringBuilder requestURL = new StringBuilder(request.getRequestURL().toString());
String queryString = request.getQueryString();