如何在检票口的WebLogic形式的身份验证 [英] How to make weblogic form authentication in wicket

查看:140
本文介绍了如何在检票口的WebLogic形式的身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使检票口的WebLogic表单验证,但我不知道如何创建登录页面。我跟着这个教程哪里是在JSP中的例子:

http://docs.oracle.com/cd/E13222_01/wls/docs100/security/thin_client.html#wp1057581

我创建检票类似的形式,但我不知道当我按下提交按钮怎么办。有一些所谓的j_security_check行动,但我不知道我应该如何在Java和检票实现它

更新:
我使用WebLogic 10.something和我不能使用最新
我试图创建自己的impelemtation但是当我尝试使用登录检票口抛出异常:

  java.lang.NoSuchMethodError:使用javax / servlet的/ HTTP / HttpServletRequest.login(Ljava /朗/字符串; Ljava /朗/字符串;)V。

我应该在web.xml中添加的servlet?

UPDATE2:

我在你的答案在我的项目中添加的形式,当我推与incorect密码提交按钮有网址:的http://本地主机:8080 /应用/ j_security_check 与状态404未找​​到。
当我添加正确的传球有网址:的http://本地主机:8080 /应用/系统管理员与状态404太

web.xml中:

 <安全约束>    <网上资源收集和GT;
        <网上资源名称>用途< /网络资源名称>
        < URL模式> /管理与LT; / URL模式>
    < /网上资源收集和GT;
    < AUTH约束>
        <角色名称> A< /角色名称>
    < / AUTH约束>
< /安全约束><安全角色>
    <角色名称> A< /角色名称>
< /安全角色><登录名,配置>
    < AUTH-方法>表并LT; / AUTH-方法>
    <形式登录,配置>
        <形式登录页和GT; /登录< /表单登录页>
        <形式的错误页面和GT; /登录< /表单错误页>
    < /表单登录,配置>
< /登录,配置>

更新3:我发现这个例子: HTTPS://cwiki.apache。组织/便门/ servlet的容器​​authentication.html 哪里是我想要的,但也有使用检票1.4,但我使用的检票口1.5。而且有很多未知的类,但也许有人可以把它改写到1.5版本检票


解决方案

  1。你在你的web.xml错过了安全领域的名称
<登录名,配置>
< AUTH-方法>表并LT; / AUTH-方法>
<境界-名称>&MYREALM LT; /领域-名称>
<形式登录,配置>
.....
< /登录,配置>
领域名必须在WebLogic中安全领域设置匹配(MYREALM是WebLogic默认)2.您错过了的weblogic.xml
在你的web.xml你定义了一个称为LT安全角色;一>中你需要的Weblogic组映射到角色,如
< XML版本=1.0编码=UTF-8&GT?;
< WebLogic的web应用程序的xmlns =htt​​p://www.bea.com/ns/weblogic/90>
<安全角色分配>
<角色名称> A< /角色名称>
<委托名称>&weblogic的LT; /委托名称>
< /安全角色分配>
< / WebLogic的web应用程序>
请把webloigc.xml在WEB-INF文件夹

I want make weblogic form validation in wicket but I dont know how to create login page. I followed this tutorial where is example in jsp:

http://docs.oracle.com/cd/E13222_01/wls/docs100/security/thin_client.html#wp1057581

I create similar form in wicket but I dont know what should I do when I push submit button. There is some action called "j_security_check" but i dont know how should i implement it in java and wicket

UPDATE: I am using weblogic 10.something and I cant use newest I try to create my own impelemtation but when I try to use login wicket throw exception:

java.lang.NoSuchMethodError: javax/servlet/http/HttpServletRequest.login(Ljava/lang/String;Ljava/lang/String;)V.

should I add servlet in my web.xml ?

UPDATE2:

I add form in your answer in my project and when I push submit button with incorect password there is url: http://localhost:8080/application/j_security_check with status 404 not found. when I add correct pass there is url: http://localhost:8080/application/admin with status 404 too

web.xml:

<security-constraint>

    <web-resource-collection>
        <web-resource-name>application</web-resource-name>
        <url-pattern>/admin</url-pattern>
    </web-resource-collection>
    <auth-constraint>
        <role-name>a</role-name>
    </auth-constraint>
</security-constraint>

<security-role>
    <role-name>a</role-name>
</security-role>

<login-config>
    <auth-method>FORM</auth-method>
    <form-login-config>
        <form-login-page>/login</form-login-page>
        <form-error-page>/login</form-error-page>
    </form-login-config>
</login-config>

UPDATE 3: I found this example: https://cwiki.apache.org/WICKET/servlet-container-authentication.html where is what I want but there are using wicket 1.4 but I am using wicket 1.5. and there is a lot of unknown classes but maybe someone could rewrite it to 1.5 version of wicket

解决方案

1. You missed security realm name in your web.xml
<login-config>
<auth-method>FORM</auth-method>
<realm-name>myrealm</realm-name>
<form-login-config>
.....
</login-config>
The realm-name must match the security realm setup in Weblogic (myrealm is the WebLogic default)

2. You missed the weblogic.xml
in your web.xml you defined one security role called <a>, you need map Weblogic Group to the role, such as 
<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/90">    
<security-role-assignment>
<role-name>a</role-name>
<principal-name>weblogic</principal-name>
</security-role-assignment>
</weblogic-web-app>
Please put webloigc.xml in WEB-INF folder

这篇关于如何在检票口的WebLogic形式的身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆