From 074b4cbfc13cc12d477f0799aba5d1cdb599a218 Mon Sep 17 00:00:00 2001 From: Andrew Berezovskyi Date: Fri, 6 Feb 2026 19:18:52 +0100 Subject: [PATCH] docs: auth configuration override examlple --- src/docker-compose.yml | 2 + src/oslcOAuthStore.xml | 46 +++++++++++++++++++ .../gen/auth/AuthenticationApplication.java | 21 ++++++++- 3 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 src/oslcOAuthStore.xml diff --git a/src/docker-compose.yml b/src/docker-compose.yml index 98f08f48..cf628a37 100644 --- a/src/docker-compose.yml +++ b/src/docker-compose.yml @@ -5,6 +5,8 @@ services: dockerfile: server-rm/Dockerfile ports: - "127.0.0.1:8800:8080" +# volumes: +# - ./oslcOAuthStore.xml:/var/lib/jetty/oslcOAuthStore.xml:ro # Uncomment to configure the base URL for reverse proxy or custom domain deployments # environment: # - LYO_BASEURL=https://mytoolchain.example.com:9443/refimpl/rm diff --git a/src/oslcOAuthStore.xml b/src/oslcOAuthStore.xml new file mode 100644 index 00000000..0998dc6d --- /dev/null +++ b/src/oslcOAuthStore.xml @@ -0,0 +1,46 @@ + + + + + + + web-app-consumer + d2ViLWFwcC1zZWNyZXQtYTFiMmMzZDRlNWY2ZzdoOGk5ajA= + Web Application Client + false + false + + + + + + mobile-app-consumer + bW9iaWxlLWFwcC1zZWNyZXQtazlsOG03bjZvNXA0cTNyMnMxdDA= + Mobile Application Client + false + false + + + + + + automation-consumer + YXV0b21hdGlvbi1zZWNyZXQtdTF2Mncza3g0eTV6NmE3YjhjOWQw + Automation Service + true + false + + + + + + dev-test-consumer + ZGV2LXRlc3Qtc2VjcmV0LWUxZjJnM2g0aTVqNms3bDhtOW4w + Development Test Client + false + true + + + diff --git a/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/auth/AuthenticationApplication.java b/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/auth/AuthenticationApplication.java index cb716c07..4ec81ca8 100644 --- a/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/auth/AuthenticationApplication.java +++ b/src/server-rm/src/main/java/co/oslc/refimpl/rm/gen/auth/AuthenticationApplication.java @@ -101,11 +101,28 @@ public static AuthenticationApplication getApplication() { // End of user code return authenticationApplication; } - + + /** + * Returns filename for the auth configuration; warns and returns null if missing + */ public String getOslcConsumerStoreFilename() { + if (oslcConsumerStoreFilename == null) { + log.warn("OSLC Consumer Store filename is null"); + return null; + } + + java.nio.file.Path absolutePath = + java.nio.file.Paths.get(oslcConsumerStoreFilename).toAbsolutePath(); + log.debug("OSLC Consumer Store filename - relative: {}, absolute: {}", + oslcConsumerStoreFilename, absolutePath); + + if (!java.nio.file.Files.exists(absolutePath)) { + log.warn("OSLC Consumer Store file does not exist: {}", absolutePath); + } + return oslcConsumerStoreFilename; } - + @Override public String getName() { // Display name for this application.