Browse Source

- OAUTH2_LOGIN_STYLE popup or redirect, part 2.

Thanks to xet7 !
Lauri Ojansivu 6 years ago
parent
commit
7919ae3628

+ 2 - 0
Dockerfile

@@ -27,6 +27,7 @@ ARG BROWSER_POLICY_ENABLED
 ARG TRUSTED_URL
 ARG TRUSTED_URL
 ARG WEBHOOKS_ATTRIBUTES
 ARG WEBHOOKS_ATTRIBUTES
 ARG OAUTH2_ENABLED
 ARG OAUTH2_ENABLED
+ARG OAUTH2_LOGIN_STYLE
 ARG OAUTH2_CLIENT_ID
 ARG OAUTH2_CLIENT_ID
 ARG OAUTH2_SECRET
 ARG OAUTH2_SECRET
 ARG OAUTH2_SERVER_URL
 ARG OAUTH2_SERVER_URL
@@ -123,6 +124,7 @@ ENV BUILD_DEPS="apt-utils bsdtar gnupg gosu wget curl bzip2 build-essential pyth
     TRUSTED_URL="" \
     TRUSTED_URL="" \
     WEBHOOKS_ATTRIBUTES="" \
     WEBHOOKS_ATTRIBUTES="" \
     OAUTH2_ENABLED=false \
     OAUTH2_ENABLED=false \
+    OAUTH2_LOGIN_STYLE=redirect \
     OAUTH2_CLIENT_ID="" \
     OAUTH2_CLIENT_ID="" \
     OAUTH2_SECRET="" \
     OAUTH2_SECRET="" \
     OAUTH2_SERVER_URL="" \
     OAUTH2_SERVER_URL="" \

+ 6 - 0
docker-compose.yml

@@ -272,6 +272,8 @@ services:
       # 2) Configure the environment variables. This differs slightly
       # 2) Configure the environment variables. This differs slightly
       #     by installation type, but make sure you have the following:
       #     by installation type, but make sure you have the following:
       #- OAUTH2_ENABLED=true
       #- OAUTH2_ENABLED=true
+      # OAuth2 login style: popup or redirect.
+      #- OAUTH2_LOGIN_STYLE=redirect
       # Application GUID captured during app registration:
       # Application GUID captured during app registration:
       #- OAUTH2_CLIENT_ID=xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx
       #- OAUTH2_CLIENT_ID=xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx
       # Secret key generated during app registration:
       # Secret key generated during app registration:
@@ -292,6 +294,8 @@ services:
       # ==== OAUTH2 KEYCLOAK ====
       # ==== OAUTH2 KEYCLOAK ====
       # https://github.com/wekan/wekan/wiki/Keycloak  <== MAPPING INFO, REQUIRED
       # https://github.com/wekan/wekan/wiki/Keycloak  <== MAPPING INFO, REQUIRED
       #- OAUTH2_ENABLED=true
       #- OAUTH2_ENABLED=true
+      # OAuth2 login style: popup or redirect.
+      #- OAUTH2_LOGIN_STYLE=redirect
       #- OAUTH2_CLIENT_ID=<Keycloak create Client ID>
       #- OAUTH2_CLIENT_ID=<Keycloak create Client ID>
       #- OAUTH2_SERVER_URL=<Keycloak server name>/auth
       #- OAUTH2_SERVER_URL=<Keycloak server name>/auth
       #- OAUTH2_AUTH_ENDPOINT=/realms/<keycloak realm>/protocol/openid-connect/auth
       #- OAUTH2_AUTH_ENDPOINT=/realms/<keycloak realm>/protocol/openid-connect/auth
@@ -305,6 +309,8 @@ services:
       # Enable the OAuth2 connection
       # Enable the OAuth2 connection
       #- OAUTH2_ENABLED=true
       #- OAUTH2_ENABLED=true
       # OAuth2 docs: https://github.com/wekan/wekan/wiki/OAuth2
       # OAuth2 docs: https://github.com/wekan/wekan/wiki/OAuth2
+      # OAuth2 login style: popup or redirect.
+      #- OAUTH2_LOGIN_STYLE=redirect
       # OAuth2 Client ID.
       # OAuth2 Client ID.
       #- OAUTH2_CLIENT_ID=abcde12345
       #- OAUTH2_CLIENT_ID=abcde12345
       # OAuth2 Secret.
       # OAuth2 Secret.

+ 2 - 1
rebuild-wekan.bat

@@ -1,6 +1,7 @@
 @ECHO OFF
 @ECHO OFF
 
 
-REM IN PROGRESS: Build on Windows.
+REM NOTE: THIS .BAT DOES NOT WORK !!
+REM Use instead this webpage instructions to build on Windows:
 REM https://github.com/wekan/wekan/wiki/Install-Wekan-from-source-on-Windows
 REM https://github.com/wekan/wekan/wiki/Install-Wekan-from-source-on-Windows
 REM Please add fix PRs, like config of MongoDB etc.
 REM Please add fix PRs, like config of MongoDB etc.
 
 

+ 7 - 1
releases/virtualbox/start-wekan.sh

@@ -71,6 +71,8 @@
         # 2) Configure the environment variables. This differs slightly
         # 2) Configure the environment variables. This differs slightly
         #     by installation type, but make sure you have the following:
         #     by installation type, but make sure you have the following:
         #export OAUTH2_ENABLED=true
         #export OAUTH2_ENABLED=true
+        # OAuth2 login style: popup or redirect.
+        #export OAUTH2_LOGIN_STYLE=redirect
         # Application GUID captured during app registration:
         # Application GUID captured during app registration:
         #export OAUTH2_CLIENT_ID=xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx
         #export OAUTH2_CLIENT_ID=xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx
         # Secret key generated during app registration:
         # Secret key generated during app registration:
@@ -91,6 +93,8 @@
         # ==== OAUTH2 KEYCLOAK ====
         # ==== OAUTH2 KEYCLOAK ====
         # https://github.com/wekan/wekan/wiki/Keycloak  <== MAPPING INFO, REQUIRED
         # https://github.com/wekan/wekan/wiki/Keycloak  <== MAPPING INFO, REQUIRED
         #export OAUTH2_ENABLED=true
         #export OAUTH2_ENABLED=true
+        # OAuth2 login style: popup or redirect.
+        #export OAUTH2_LOGIN_STYLE=redirect
         #export OAUTH2_CLIENT_ID=<Keycloak create Client ID>
         #export OAUTH2_CLIENT_ID=<Keycloak create Client ID>
         #export OAUTH2_SERVER_URL=<Keycloak server name>/auth
         #export OAUTH2_SERVER_URL=<Keycloak server name>/auth
         #export OAUTH2_AUTH_ENDPOINT=/realms/<keycloak realm>/protocol/openid-connect/auth
         #export OAUTH2_AUTH_ENDPOINT=/realms/<keycloak realm>/protocol/openid-connect/auth
@@ -99,11 +103,13 @@
         #export OAUTH2_SECRET=<keycloak client secret>
         #export OAUTH2_SECRET=<keycloak client secret>
         #-----------------------------------------------------------------
         #-----------------------------------------------------------------
         # ==== OAUTH2 DOORKEEPER ====
         # ==== OAUTH2 DOORKEEPER ====
+        # OAuth2 docs: https://github.com/wekan/wekan/wiki/OAuth2
         # https://github.com/wekan/wekan/issues/1874
         # https://github.com/wekan/wekan/issues/1874
         # https://github.com/wekan/wekan/wiki/OAuth2
         # https://github.com/wekan/wekan/wiki/OAuth2
         # Enable the OAuth2 connection
         # Enable the OAuth2 connection
         #export OAUTH2_ENABLED=true
         #export OAUTH2_ENABLED=true
-        # OAuth2 docs: https://github.com/wekan/wekan/wiki/OAuth2
+        # OAuth2 login style: popup or redirect.
+        #export OAUTH2_LOGIN_STYLE=redirect
         # OAuth2 Client ID.
         # OAuth2 Client ID.
         #export OAUTH2_CLIENT_ID=abcde12345
         #export OAUTH2_CLIENT_ID=abcde12345
         # OAuth2 Secret.
         # OAuth2 Secret.

+ 1 - 1
server/authentication.js

@@ -69,7 +69,7 @@ Meteor.startup(() => {
         { service: 'oidc' },
         { service: 'oidc' },
         {
         {
           $set: {
           $set: {
-            loginStyle: 'redirect',
+            loginStyle: process.env.OAUTH2_LOGIN_STYLE,
             clientId: process.env.OAUTH2_CLIENT_ID,
             clientId: process.env.OAUTH2_CLIENT_ID,
             secret: process.env.OAUTH2_SECRET,
             secret: process.env.OAUTH2_SECRET,
             serverUrl: process.env.OAUTH2_SERVER_URL,
             serverUrl: process.env.OAUTH2_SERVER_URL,

File diff suppressed because it is too large
+ 0 - 0
snap-src/bin/config


+ 6 - 0
snap-src/bin/wekan-help

@@ -94,6 +94,12 @@ echo -e "\t$ snap set $SNAP_NAME oauth2-client-id='54321abcde'"
 echo -e "\t-Disable the OAuth2 Client ID of Wekan:"
 echo -e "\t-Disable the OAuth2 Client ID of Wekan:"
 echo -e "\t$ snap set $SNAP_NAME oauth2-client-id=''"
 echo -e "\t$ snap set $SNAP_NAME oauth2-client-id=''"
 echo -e "\n"
 echo -e "\n"
+echo -e "OAuth2 login style: popup or redirect. Default: redirect"
+echo -e "To enable the OAuth2 login style popup of Wekan:"
+echo -e "\t$ snap set $SNAP_NAME oauth2-login-style='popup'"
+echo -e "\t-Disable the OAuth2 login style popup of Wekan:"
+echo -e "\t$ snap set $SNAP_NAME oauth2-login-style='redirect'"
+echo -e "\n"
 echo -e "OAuth2 Secret."
 echo -e "OAuth2 Secret."
 echo -e "To enable the OAuth2 Secret of Wekan:"
 echo -e "To enable the OAuth2 Secret of Wekan:"
 echo -e "\t$ snap set $SNAP_NAME oauth2-secret='54321abcde'"
 echo -e "\t$ snap set $SNAP_NAME oauth2-secret='54321abcde'"

+ 7 - 0
start-wekan.bat

@@ -1,5 +1,12 @@
 REM ------------------------------------------------------------
 REM ------------------------------------------------------------
 
 
+REM NOTE: THIS .BAT DOES NOT WORK !!
+REM Use instead this webpage instructions to build on Windows:
+REM https://github.com/wekan/wekan/wiki/Install-Wekan-from-source-on-Windows
+REM Please add fix PRs, like config of MongoDB etc.
+
+REM ------------------------------------------------------------
+
 REM # Debug OIDC OAuth2 etc.
 REM # Debug OIDC OAuth2 etc.
 REM SET DEBUG=true
 REM SET DEBUG=true
 
 

+ 8 - 1
start-wekan.sh

@@ -89,6 +89,9 @@ function wekan_repo_check(){
       # 2) Configure the environment variables. This differs slightly
       # 2) Configure the environment variables. This differs slightly
       #     by installation type, but make sure you have the following:
       #     by installation type, but make sure you have the following:
       #export OAUTH2_ENABLED=true
       #export OAUTH2_ENABLED=true
+      # OAuth2 docs: https://github.com/wekan/wekan/wiki/OAuth2
+      # OAuth2 login style: popup or redirect.
+      #export OAUTH2_LOGIN_STYLE=redirect
       # Application GUID captured during app registration:
       # Application GUID captured during app registration:
       #export OAUTH2_CLIENT_ID=xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx
       #export OAUTH2_CLIENT_ID=xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx
       # Secret key generated during app registration:
       # Secret key generated during app registration:
@@ -109,6 +112,8 @@ function wekan_repo_check(){
       # ==== OAUTH2 KEYCLOAK ====
       # ==== OAUTH2 KEYCLOAK ====
       # https://github.com/wekan/wekan/wiki/Keycloak  <== MAPPING INFO, REQUIRED
       # https://github.com/wekan/wekan/wiki/Keycloak  <== MAPPING INFO, REQUIRED
       #export OAUTH2_ENABLED=true
       #export OAUTH2_ENABLED=true
+      # OAuth2 login style: popup or redirect.
+      #export OAUTH2_LOGIN_STYLE=redirect
       #export OAUTH2_CLIENT_ID=<Keycloak create Client ID>
       #export OAUTH2_CLIENT_ID=<Keycloak create Client ID>
       #export OAUTH2_SERVER_URL=<Keycloak server name>/auth
       #export OAUTH2_SERVER_URL=<Keycloak server name>/auth
       #export OAUTH2_AUTH_ENDPOINT=/realms/<keycloak realm>/protocol/openid-connect/auth
       #export OAUTH2_AUTH_ENDPOINT=/realms/<keycloak realm>/protocol/openid-connect/auth
@@ -117,11 +122,13 @@ function wekan_repo_check(){
       #export OAUTH2_SECRET=<keycloak client secret>
       #export OAUTH2_SECRET=<keycloak client secret>
       #-----------------------------------------------------------------
       #-----------------------------------------------------------------
       # ==== OAUTH2 DOORKEEPER ====
       # ==== OAUTH2 DOORKEEPER ====
+      # OAuth2 docs: https://github.com/wekan/wekan/wiki/OAuth2
       # https://github.com/wekan/wekan/issues/1874
       # https://github.com/wekan/wekan/issues/1874
       # https://github.com/wekan/wekan/wiki/OAuth2
       # https://github.com/wekan/wekan/wiki/OAuth2
       # Enable the OAuth2 connection
       # Enable the OAuth2 connection
       #export OAUTH2_ENABLED=true
       #export OAUTH2_ENABLED=true
-      # OAuth2 docs: https://github.com/wekan/wekan/wiki/OAuth2
+      # OAuth2 login style: popup or redirect.
+      #export OAUTH2_LOGIN_STYLE=redirect
       # OAuth2 Client ID.
       # OAuth2 Client ID.
       #export OAUTH2_CLIENT_ID=abcde12345
       #export OAUTH2_CLIENT_ID=abcde12345
       # OAuth2 Secret.
       # OAuth2 Secret.

Some files were not shown because too many files changed in this diff