Questions tagged [j-security-check]

j_security_check is a default URL in web applications using JAAS, the Java Authentication and Authorization Service, and Spring Security. It is used to implement security.

j_seucrity_check is the action that needs to be set on a html form when using Java Servlet Form Authentication (container security).

See the Java Tutorial for more information.

163 questions
160
votes
4 answers

Performing user authentication in Java EE / JSF using j_security_check

I'm wondering what the current approach is regarding user authentication for a web application making use of JSF 2.0 (and if any components do exist) and Java EE 6 core mechanisms (login/check permissions/logouts) with user information hold in a JPA…
ngeek
  • 7,733
  • 11
  • 36
  • 42
11
votes
2 answers

How to get number of connected users and their role using j_security_check?

I get the username of the connected user (using j_security_check) this way, through a managed bean: ...... username = FacesContext.getCurrentInstance().getExternalContext().getUserPrincipal().getName(); And then display it in a jsf page this…
Hanynowsky
  • 2,970
  • 5
  • 32
  • 43
7
votes
0 answers

Perform action after the j_security_check?

I'm doing an audit system that logs user actions. I need to record when a user performs a login. I searched different places but I always end up running into the same solution, use "filters". The above solutions do not work for me. There are no…
Crapo Wolf
  • 2,241
  • 2
  • 11
  • 20
7
votes
2 answers

ViewExpiredException not thrown on ajax request if JSF page is protected by j_security_check

I have a JSF page which is not protected by j_security_check. I perform the following steps: Open the JSF page in a browser. Restart the server. Click a command button on the JSF page to initiate an ajax call. Firebug shows that a…
Ran Tang
  • 241
  • 5
  • 12
6
votes
1 answer

j_security_check redirect

I am learning Java servlets on Tomcat environment. I am learning how to use form based login authentication using j_security_check. So, in my servlet, I have a login page that has j_username and j_password. In web.xml file of that servlet, I have…
BlueChips23
  • 1,861
  • 5
  • 34
  • 53
6
votes
2 answers

Form-based Authentication using HttpClient - j_security_check

I'm trying to authenticate myself to a website that uses form-based authentication (e.g., facebook.com) using the Apache HttpClient Java library. Using this website's program as a main example:…
5
votes
1 answer

How can I get j_username on my index.jsp after successful authentication with j_security_check?

I'm using j_security_check on a login.jsp. The server is GlassFish Server 3. It all works, when the user is authenticated it then opens index.jsp. My problem is I need to get j_username in my index.jsp, but I couldn't find a way of doing it. All…
Monica
  • 51
  • 1
  • 3
5
votes
0 answers

Jboss Wildfly 8.1 session timeout on login page

I have an application running on JBoss 8.1 with JAAS form based login (j_security_check) and everything works fine. My problem is: 1) the user logs out and is redirected on the login page 2) here a session timeout occurs (the user doesn't know…
5
votes
1 answer

j_security_check called directly

I have a web application, and I want the home page to include a login form, among other data. If the user choose to log in, he should be redirected to another page (e.g. login_success.jsp). My question is: may I use j_security_check mechanism for…
Andrei G
  • 660
  • 5
  • 12
  • 20
5
votes
1 answer

How to set up a JDBCRealm in Apache Tomcat 7?

I would like that the users (which are allowed to log on to my site) are loaded from a MySQL database. To do that I want to set up a JDBCRealm for my Apache Tomcat 7 application server. I've read through the documentation and created a database…
Benny Code
  • 51,456
  • 28
  • 233
  • 198
4
votes
1 answer

Welcome page is displayed without being redirected to login page

I have following web.xml file I kept welcome page into security check so that it would redirect to login page but the welcome page is displayed without user loggin in. Is this the correct way?
kinkajou
  • 3,664
  • 25
  • 75
  • 128
4
votes
3 answers

How can I get the logged-in user's username using JDBCRealm?

I'm running Glassfish 3.0 and I'm implementing JDBCRealm for login authentication. The username and roles are saved in a table called usertable. The authentication is working as expected. But the problem is now when the user logs in, how can I…
fareed
  • 3,034
  • 6
  • 37
  • 65
4
votes
1 answer

j_security_check vs Programmatic Security

I'm building a Web application using jsf, ejbs and jpa. I currently use form based j_security_check to handle authentication. I need to implement support for cookies ie "Remember me" option. Also I want to prevent brute force attacks. ie Lock a…
greenkode
  • 4,001
  • 1
  • 26
  • 29
4
votes
4 answers

Add CORS headers to response of j_security_check

I'm building a REST API with jax-rs and WildFly 10. Some of the endpoints are secured. I'm using FORM based authentication. In my javascript code, I check the response of the AJAX request, and if it is set to 401 Unauthorized, I then present a login…
Stijn de Witt
  • 40,192
  • 13
  • 79
  • 80
4
votes
2 answers

How to use j_security_check jsf

I want to use j_security_check authentication in order to validate the user credentials. Basically what I am trying to achieve is when the user press submit then in case he is using wrong credentials then a message (p:growl) will show and if it’s…
angus
  • 3,210
  • 10
  • 41
  • 71
1
2 3
10 11