From af2f8155e57831d06d8da9e4ef138376bd96e319 Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Fri, 21 May 2021 12:32:02 +0530 Subject: [PATCH] added webapp authenticator component --- .../pom.xml | 14 +-- .../repository/conf/application-mgt.xml.j2 | 10 +- .../conf/webapp-authenticator-config.xml.j2 | 118 ++++++++++++++++++ .../src/main/resources/p2.inf | 1 + pom.xml | 2 + 5 files changed, 133 insertions(+), 12 deletions(-) create mode 100644 features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf_templates/templates/repository/conf/webapp-authenticator-config.xml.j2 diff --git a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml index 2d3df3e061..e88716313f 100644 --- a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml +++ b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml @@ -63,13 +63,13 @@ javax.xml.bind.annotation, javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}";resolution:=optional, javax.xml.validation, - org.apache.catalina, - org.apache.catalina.connector, - org.apache.catalina.util, + + + org.apache.commons.logging, - org.apache.coyote, - org.apache.tomcat.util.buf, - org.apache.tomcat.util.http, + + + org.osgi.service.component, org.osgi.framework, org.w3c.dom, @@ -106,7 +106,7 @@ org.apache.commons.pool.impl, org.apache.http.conn, org.apache.http.impl.conn, - javax.xml.soap; version="${javax.xml.soap.imp.pkg.version}", + javax.xml.stream, org.apache.axiom.*; version="${axiom.osgi.version.range}", org.wso2.carbon.registry.core.*, diff --git a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf_templates/templates/repository/conf/application-mgt.xml.j2 b/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf_templates/templates/repository/conf/application-mgt.xml.j2 index 8774964271..2550288629 100644 --- a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf_templates/templates/repository/conf/application-mgt.xml.j2 +++ b/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf_templates/templates/repository/conf/application-mgt.xml.j2 @@ -195,11 +195,11 @@ Video Players & Editors Weather GooglePlaySyncedApp - {% if application_mgt_conf.app_categories is defined %} - {%- for app_category in application_mgt_conf.app_categories -%} - {{app_category}} - {% endfor %} - {% endif %} + {% if application_mgt_conf.app_categories is defined %} + {%- for app_category in application_mgt_conf.app_categories -%} + {{app_category}} + {% endfor %} + {% endif %} diff --git a/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf_templates/templates/repository/conf/webapp-authenticator-config.xml.j2 b/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf_templates/templates/repository/conf/webapp-authenticator-config.xml.j2 new file mode 100644 index 0000000000..187c9131fe --- /dev/null +++ b/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf_templates/templates/repository/conf/webapp-authenticator-config.xml.j2 @@ -0,0 +1,118 @@ + + + + OAuth + {% if webapp_auth_conf.authenticator.oauth is defined %} + {{webapp_auth_conf.authenticator.oauth.class_name}} + + {% for property_name,property_value in webapp_auth_conf.authenticator.oauth.parameter_options.items() %} + {{property_value}} + {% endfor %} + + {% else %} + org.wso2.carbon.webapp.authenticator.framework.authenticator.OAuthAuthenticator + + false + https://${iot.keymanager.host}:${iot.keymanager.https.port} + admin + admin + 100 + 100 + + {% endif %} + + + BasicAuth + {% if webapp_auth_conf.authenticator.basic_auth is defined %} + {{webapp_auth_conf.authenticator.basic_auth.class_name}} + + {% for property_name,property_value in webapp_auth_conf.authenticator.basic_auth.parameter_options.items() %} + {{property_value}} + {% endfor %} + + {% else %} + org.wso2.carbon.webapp.authenticator.framework.authenticator.BasicAuthAuthenticator + {% endif %} + + + JWT + {% if webapp_auth_conf.authenticator.jwt is defined %} + {{webapp_auth_conf.authenticator.jwt.class_name}} + + {% for property_name,property_value in webapp_auth_conf.authenticator.jwt.parameter_options.items() %} + {{property_value}} + {% endfor %} + + {% else %} + org.wso2.carbon.webapp.authenticator.framework.authenticator.JWTAuthenticator + + + wso2carbon + wso2carbon + wso2carbon + wso2carbon + + {% endif %} + + + CertificateAuth + {% if webapp_auth_conf.authenticator.certificate_auth is defined %} + {{webapp_auth_conf.authenticator.certificate_auth.class_name}} + + {% for property_name,property_value in webapp_auth_conf.authenticator.certificate_auth.parameter_options.items() %} + {{property_value}} + {% endfor %} + + {% else %} + org.wso2.carbon.webapp.authenticator.framework.authenticator.CertificateAuthenticator + {% endif %} + + + OTPAuth + {% if webapp_auth_conf.authenticator.otpauth is defined %} + {{webapp_auth_conf.authenticator.otpauth.class_name}} + + {% for property_name,property_value in webapp_auth_conf.authenticator.otpauth.parameter_options.items() %} + {{property_value}} + {% endfor %} + + {% else %} + org.wso2.carbon.webapp.authenticator.framework.authenticator.OneTimeTokenAuthenticator + {% endif %} + + + BST + {% if webapp_auth_conf.authenticator.bst is defined %} + {{webapp_auth_conf.authenticator.bst.class_name}} + + {% for property_name,property_value in webapp_auth_conf.authenticator.bst.parameter_options.items() %} + {{property_value}} + {% endfor %} + + {% else %} + org.wso2.carbon.webapp.authenticator.framework.authenticator.BSTAuthenticator + + false + https://${iot.keymanager.host}:${iot.keymanager.https.port} + admin + admin + 100 + 100 + + {% endif %} + + {% if webapp_auth_conf.authenticators is defined %} + {%- for authenticator in webapp_auth_conf.authenticators -%} + + {{authenticator.name}} + {{authenticator.class_name}} + + {% for property_name,property_value in authenticator.parameter_options.items() %} + {{property_value}} + {% endfor %} + + + {% endfor %} + {% endif %} + + diff --git a/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/p2.inf b/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/p2.inf index 7b1ad15df1..a526d71269 100644 --- a/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/p2.inf +++ b/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/p2.inf @@ -1,2 +1,3 @@ instructions.configure = \ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.webapp.authenticator.framework.server_${feature.version}/conf/webapp-authenticator-config.xml,target:${installFolder}/../../conf/etc/webapp-authenticator-config.xml,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.webapp.authenticator.framework.server_${feature.version}/conf_templates/,target:${installFolder}/../../resources/conf/,overwrite:true);\ diff --git a/pom.xml b/pom.xml index e3e7998167..afa35d50db 100644 --- a/pom.xml +++ b/pom.xml @@ -44,6 +44,7 @@ components/certificate-mgt components/ui-request-interceptor components/transport-mgt + components/webapp-authenticator-framework features/device-mgt features/apimgt-extensions features/application-mgt @@ -54,6 +55,7 @@ features/jwt-client features/device-mgt-extensions features/transport-mgt + features/webapp-authenticator-framework