How to make weblogic form authentication in wicket

淺唱寂寞╮ 提交于 2019-12-06 15:28:29
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

I don't know if your project is already at an advanced stage, or if it is hard to migrate/use your code to/in another wicket project - I suggest you use an existing framework to do that, like Shiro (http://shiro.apache.org/index.html) which is very cool.

Apache Shiro is a powerful and easy-to-use Java security framework that performs authentication, authorization, cryptography, and session management. With Shiro’s easy-to-understand API, you can quickly and easily secure any application – from the smallest mobile applications to the largest web and enterprise applications.

If you want to use this in Wicket I suggest you pickup the 55minutes project (https://github.com/55minutes/fiftyfive-wicket), which works with Shiro.

The 55 Minutes Wicket project is a set of tools and libraries we use for enhancing our productivity with the Apache Wicket Java web framework. We've made our code available as open source to share with the Wicket community.

In 55minutes login screens are already built, and all you have to do is define the access configurations to the database where the login info/tables are at. Hope it helps. Regards

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!