I don't have a publicly available environment. I should hopefully have time to set one up later in the week.
ErikGrimes
@ErikGrimes
Posts made by ErikGrimes
-
RE: Authenticating jsreport with Keycloak as the authorization server
-
RE: Authenticating jsreport with Keycloak as the authorization server
Thanks for pointing that out. I did have a typo in the jwks endpoint which I corrected. This fixed the 404 error. I get this error now.
The OpenID configuration is below. I'm only able to upload images. Hopefully you can read it.
-
RE: Authenticating jsreport with Keycloak as the authorization server
Thanks. I updated the image with the main.js you provided and tried again. This is the result.
Any thoughts?
-
RE: Authenticating jsreport with Keycloak as the authorization server
I'm using a Docker image derived from the standard 3.1.1 image with a custom jsreport.json.config.
FROM jsreport/jsreport:3.1.1 COPY --chown=jsreport:jsreport jsreport.config.json /app
{ "httpPort": 5488, "store": { "provider": "fs" }, "logger": { "console": { "transport": "console", "level": "debug" }, "file": { "transport": "file", "level": "info", "filename": "logs/reporter.log" }, "error": { "transport": "file", "level": "error", "filename": "logs/error.log" } }, "allowLocalFilesAccess": false, "reportTimeout": 60000, "workers": { "numberOfWorkers": 2 }, "extensions": { "authentication": { "enabled": true, "cookieSession": { "secret": "******" }, "admin": { "username": "admin", "password": "******" }, "authorizationServer": { "name": "Health Dynamics", "issuer": "https://accounts.healthdynamics.test/auth/realms/master", "endpoints": { "jwks": "https://accounts.healthdynamics.test/auth/realms/master/.well-known/openid-configuration/certs", "authorization": "https://accounts.healthdynamics.test/auth/realms/master/protocol/openid-connect/auth", "token": "https://accounts.healthdynamics.test/auth/realms/master/protocol/openid-connect/token", "introspection": "https://accounts.healthdynamics.test/auth/realms/master/protocol/openid-connect/token/introspect", "userinfo": "http://accounts.healthdynamics.test/auth/realms/master/protocol/openid-connect/userinfo" }, "studioClient": { "clientId": "jsreport-studio", "clientSecret": "******" }, "apiResource": { "clientId": "jsreport-api", "clientSecret": "******" }, "usernameField": "username", "timeout": 6000, "authorizationRequest": { "scope": [ "openid", "profile" ], "introspectionRequest": { "tokenValidScopes": [ "jsreport" ], "extraBody": {} } } } }, "authorization": { "enabled": true } } }
I've tried this config with both the array and string versions of scopes.
-
Authenticating jsreport with Keycloak as the authorization server
Hello,
I'm working on authenticating jsreport 3.1.1 with Keycloak as the authorization server. After executing the OAuth flow and being redirected back to jsreport, jsreport records the error below.
Error: Failed to serialize user into session at pass (/app/node_modules/passport/lib/authenticator.js:281:19) at serialized (/app/node_modules/passport/lib/authenticator.js:286:7) at /app/node_modules/@jsreport/jsreport-authentication/lib/main.js:163:42 at pass (/app/node_modules/passport/lib/authenticator.js:294:9) at Authenticator.serializeUser (/app/node_modules/passport/lib/authenticator.js:299:5) at SessionManager.logIn (/app/node_modules/passport/lib/sessionmanager.js:14:8) at IncomingMessage.req.login.req.logIn (/app/node_modules/passport/lib/http/request.js:50:33) at /app/node_modules/@jsreport/jsreport-authentication/lib/main.js:352:13 at allFailed (/app/node_modules/passport/lib/middleware/authenticate.js:107:18) at attempt (/app/node_modules/passport/lib/middleware/authenticate.js:180:28)
Any thoughts on what might be causing this?