What is the equivalent code in JBOSS 7 for Weblogic's login security module code Authenticate.authenticate()
Asked
Active
Viewed 245 times
0

J. Chomel
- 8,193
- 15
- 41
- 69

vijay ragavan
- 1
- 2
-
You should tell us what you know about what Weblo' s`Authenticate.authenticate()` does, and you're trying to do with JBOSS – J. Chomel Jan 24 '17 at 11:58
1 Answers
0
I recommend you toroughfully read JBOSS excellent migration guide .
WebLogic provides a proprietary ServletAuthentication class to perform programmatic login. In JBoss AS 7, you can use the standard Java EE6 Servlet 3.0
HttpServletRequest.login()
method to perform programmatic login or you can define a element in theweb.xml
file.To enable programmatic login, you must replace the WebLogic proprietary code with one of the following:
You can add the following annotations to the Servlet class that performs the authentication.
// Imports for annotations import javax.annotation.security.DeclareRoles; import javax.servlet.annotation.WebServlet; import javax.servlet.annotation.HttpConstraint; import javax.servlet.annotation.ServletSecurity; @WebServlet("/securedUrlPattern") @ServletSecurity(@HttpConstraint(rolesAllowed = { "myRole" })) @DeclareRoles("myRole") public class SecuredServlet extends HttpServlet { //Rest of code }
- If you prefer not to use the standard servlet, you can instead add a element containing a dummy URL pattern to the
web.xml
file. This notifies JBoss to create a default Authenticator. Failure to create a element in theweb.xml
file may result in the error message "No authenticator available for programmatic login".
Another reason we should choose JBOSS over Weblogic