I am using form-based authentication and j_security_check in my j2ee application which runs on glassfish 3.1. Problem is when login succeed I have to update some data related to authenticated user. How to make post-login operation after j_security_check ends it's execution? Thanks.
post login operation with j_security_check
2k Views Asked by user992140 At
2
There are 2 best solutions below
2
Hesham Yassin
On
Create a filter which is mapped to
j_security_checkYou need to overwrite the
Originheader of the response beforechain.doFilter(request, response);of that filter and also to place your post redirect URL in the cookieWASReqURL(Or the cookie of glassfish that holds the next url)The link you chose in step 2 need to be mapped to a servlet which executes the post-j_security_check stuff and afterward, to redirect back to the overwritten link from step 2.
Related Questions in JAKARTA-EE
- How can I calculate the number of matches of a jakarta.ejb.ScheduleExpression within a time interval in Java?
- How to connect to cloud sql when using app engine instance in java 21 runtime?
- Glassfish 7.0.12 adds question mark to URL when running JAVA EE Application
- Weblogic: The Message Driven Beans in the war file are not reflecting in Weblogic 14.1.1
- Jakarta EE 10 serializing person entities results in recursion checker exception (from org.eclipse.yasson.internal.serializer.RecursionChecker)
- EJB transactions behaving differently on Wildfly 8 between Windows and Linux deployments
- Is EntityManager injected with @PersistenceContext to a @RequestScoped CDI bean thread-safe?
- Redirect user based on his Role in Jakarta EE web app
- CXF web service deployed with docker compose won't work
- Messages won't reach the JMS backend in Weblogic JMS (BEA Server)
- Using XML as config-property value
- JEE-Transaction- vs. JPA Entity Management
- Jakarta CDI force bean construction/register legacy event listeners
- WildFly localhost 'forbidden' access
- WSSTUBE0025: Error in Verifying Security in the Inbound Message (Security Requirements not met - No Security header in message)
Related Questions in JSF-2
- JSF 2 Primefaces : On Ajax reponse I can see extra updates sent by server <update id="javax.faces.Resource"> and which cause my action skipped
- Understanding HTTP sessions in JSF as session attributres are going null unexpectedly while working actively on the application
- How to clear data from datatable using primefaces and java
- CDI Interceptor fires BEFORE HttpAuthenticationMechanism validates request
- JSF user lockout after X failed login attempts
- JSF ExceptionHandler - Response already committed in some cases
- Why am I getting Class NotFound Exception using data table with jsf
- Java Beans - how to ignore boolean isXXXXMethod in favor of BOOLEAN getXXXXMethod in JSF page?
- Input element created with h:inputText is not editable
- NullPointerException during initFaces of a MyFaces 2.0 application while migrating from WLS to Tomcat
- Primefaces 10 HTML styling in DataTable emptyMessage
- jsf2, primefaces 11, Component ID j_idt20 has already been found in the view
- Hide rows of datatable based on condition in JSF2
- How to generate and preview a presigned url of a file in jsf?
- commandLink action parameter not displayed in JSF2
Related Questions in GLASSFISH-3
- Error while using jersey-client - No generator was provided
- Jaxb2RootElementHttpMessageConverter throws jakarta.xml.bind.MarshalException: null at org.glassfish.jaxb.runtime.v2.runtime.MarshallerImpl.write
- getting syntax error on a query even if the query is right for sure
- Form attribute :required => true missing from html output in production
- Error:Server chose TLSv1 using Java 8 and Glassfish 3.1.2.2
- Cannot find required version of java tm runtime environment when trying to install Glassfish
- Is there a way to package an EJB module with a WAR without an EAR?
- Jersey 1.x JAX-RS: General unhandled exception java.lang.IllegalStateException
- deployment error occurred while uploading app file (ords.war) on glassfish3 server
- How do I connect to multiple databases using JPA Glassfish Java EE?
- Upgrading from Glassfish 3.1.1 to 5.0.0, Java 7 to Java 8 - java.lang.NoClassDefFoundError: javax/validation/Payload
- Where is the cause of: Error Connecting to Glassfish Server?
- java.lang.NoSuchMethodError: org.jboss.resteasy.specimpl.BuiltResponse.getHeaders()Ljavax/ws/rs/core/MultivaluedMap;
- Force jar loading in GlassFish
- Primefaces application stops working when click button
Related Questions in J-SECURITY-CHECK
- Images in JSP page do not display on first load (cleared cache)
- How do i authenticate user by email in j_security_check?
- How does j_security_check work? How do we customize the login API call?
- JSF user logs in successfully even after user account was locked by LDAP
- JSF user lockout after X failed login attempts
- Jakarta and Glassfish - Basic authentication works, Form authentication do not
- Nginx authenticate against backend server with j_security_check
- Intercepting j_security_check on Tomcat to modify username for passion to LDAP in Struts 2
- Migrate LDAP configurarions from Websphere to Liberty
- j_security_check filter is not working in jboss eap 6.4
- Pentaho can't do Login with only ONE user. All other users works fine
- How to authenticate users on a React.JS app using j_security_check
- Rundeck: http error 500: when logging in as admin
- j_security_check form authentication with angular 4 application
- Calling secured drill URL from nodeJS using request
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
A workaround with Servlet 3.0 (or Java EE 6): Call
HttpServletRequest.login()from a managed bean and if it doesn't throw an exception do your post login operations.