gpt4 book ai didi

java - 通过小程序访问 LDAP

转载 作者:行者123 更新时间:2023-12-01 12:21:52 25 4
gpt4 key购买 nike

我需要通过小程序访问本地运行的LDAP,以便从用户自己的组织安全性对用户进行身份验证。

但是当我单击登录按钮并且小程序尝试连接到 10.0.215.45 服务器时,它会出现以下异常

     network: Connecting http://qa.mycompany.com/loginldap/jndi.properties with proxy=DIRECT
network: Connecting http://qa.mycompany.com/loginldap/jndi.properties with cookie "__utma=3105202.1962924881.1410333072.1410351890.1411365879.4; __utmz=3105202.1410333072.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); _bcvm_vrid_3210241798524429162=9098969101660648460T0DA4F9342F9A96696C8032E97870412050BB1ADC5C79D4B5EAA03F617D96473191202EB66601664B00D33A3B14F5A765452D84B6F8C4149A8E9235E8EEFB41FE; inproducttranslatemode=false"
network: Connecting http:// 10.0.215.45 :389/crossdomain.xml with proxy=DIRECT
network: Connecting http:// 10.0.215.45 :389/ with proxy=DIRECT
java.security.AccessControlException: access denied ("java.net.SocketPermission" "10.0.215.45:389" "connect,resolve")
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkConnect(Unknown Source)
at sun.plugin2.applet.SecurityManagerHelper.checkConnectHelper(Unknown Source)
at sun.plugin2.applet.AWTAppletSecurityManager.checkConnect(Unknown Source)

我在构建过程中对小程序 jar 进行了自签名

<target name="dist" depends="clean,compile" description="generate the distribution">
<mkdir dir="${dist}" />
<copy todir="${build}">
<fileset file="${src}/conf.properties" />
</copy>
<jar jarfile="${dist}/${module-jar-file}" basedir="${build}">
<manifest>
<attribute name="Permissions" value="sandbox" />
<attribute name="Codebase" value="*.mycompany.com" />
<attribute name="Application-Library-Allowable-Codebase" value="*.mycompany.com" />
<attribute name="Application-Name" value="Company - SSO" />
<attribute name="Main-Class" value="com.mycompany.authentication.sso.Application"/>
<attribute name="Entry-Point" value="com.mycompany.authentication.sso.applet.Applet" />
</manifest>
</jar>
<signjar jar="${dist}/${module-jar-file}" alias="signalias" keystore="keystore" storepass="storepass">
</signjar>
<copy todir="${dist}">
<fileset file="resources/index.html" />
</copy>

我的整体架构如下

>>>>>>>>>>>>>> INTERNET <<<<<<<<<<<<<<<

+-------------------------+
+ +
+ +
+ qa.mycompany.com + <= applet is hosted here
+ SERVER +
+ +
+-------------------------+

**************************************************************************************

>>>>>>>>>>>>>> LOCAL NETWORK <<<<<<<<<<<<<<<

+-----------------------------------------------+
+ +
+ http://qa.mycompany.com/loginldap +
+ +
+-----------------------------------------------+
+ +
+ +
+ Client browser downloading applet + =======||
+ and running + ||
+ + ||
+-----------------------------------------------+ ||
||
|| (10.0.215.45)
|| +------------+
======>> + +
+ LDAP +
+ +
+------------+

最佳答案

这是我让它工作的方法

  1. 我将 list 行从 <attribute name="Permissions"
    value="
    更改为沙盒 " /><attribute name="Permissions"
    value="
    所有权限 " />
  2. 添加了我的主机 http://qa.mycompany.com到异常(exception)站点列表,因为我没有任何适当的 SSL 证书。从“安全”选项卡下的“Java 控制面板”。

这至少在浏览器中启动并运行了我的小程序。稍后在生产环境中,我可以拥有适当的 SSL 证书并根据我的要求分配适当的权限。

关于java - 通过小程序访问 LDAP,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26609155/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com