Oauth2 adminAuth via dockercompose envvars

I am using the below in settings.js to configure my oauth2 login with authentik.

Currently I have to:
deploy nodered
exec in
install passport-openidconnect in /data/node_modules
modify the settings.js file

Is it possible to do all this via dockercompose?

command: >
      sh -c "npm install passport-openidconnect --prefix /data/node_modules"

Maybe something like

NODE_RED_ADMINAUTH_TYPE="strategy"
NODE_RED_ADMINAUTH_STRATEGY_NAME="openidconnect"
NODE_RED_ADMINAUTH_STRATEGY_OPTIONS_ISSUER='https://auth.mydomain.com/application/o/###SLUG###/'
        adminAuth: {
        type:"strategy",
        strategy: {
                name: "openidconnect",
                label: 'Sign in with authentik',
                icon:"fa-cloud",
                strategy: require("passport-openidconnect").Strategy,
                options: {
                        issuer: 'https://auth.mydomain.com/application/o/###SLUG###/',
                        authorizationURL: 'https://auth.mydomain.com/application/o/authorize/',
                        tokenURL: 'https://auth.mydomain.com/application/o/token/',
                        userInfoURL: 'https://auth.mydomain.com/application/o/userinfo/',
                        clientID: '####',
                        clientSecret: '####',
                        callbackURL: 'https://####customer###.nodered.mydomain.com/auth/strategy/callback/',
                        scope: ['email', 'profile', 'openid'],
                        proxy: true,
                verify: function(issuer, profile, done) {
                        done(null, profile)
                }
              }
            },
            users: function(user) {
                return Promise.resolve({ username: user, permissions: "*" });
            }
        },

Thanks

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.