All Questions
134 questions
0
votes
0
answers
42
views
Spring Security , session security with Thymeleaf
why i have these errors when I try to login , i want just try to log in but something went wrong , it must be redirecting to successUrl but it don't do that .
here is my security configuration
@...
0
votes
1
answer
120
views
Thymeleaf extras detects that the spring version is not compatible
I tried to build my spring boot web application and create jar file to deploy it on the dedicated server. When I build it using IDE (in my case Intellij Idea) all works fine. But when I try to execute ...
0
votes
0
answers
30
views
Spring security not working with form login from UI and basic auth for rest API both [duplicate]
I am working with Spring boot, spring security and thymeleaf for UI. I have http form based login and http session based authentication for UI part and it's working fine. But now I have to expose some ...
0
votes
1
answer
213
views
trying to process a Thymeleaf registration form with Spring Security 6 -> 403 on POST request
I'm new to Spring Boot and am trying to create a simple registration + login. However whenever I try to submit data with a POST request, the request gets blocked (403) and I'm not getting redirected ...
0
votes
0
answers
88
views
Thymeleaf exception only with JUnit test and not in the app
I'm using spring boot, spring security and thymeleaf for a web app. The problem is all is working fine when I test manually, but when I'm executing tests, I have an error :
Exception evaluating ...
2
votes
1
answer
353
views
The "redirect" routing of thymeleaf is redirecting the application to http and not to https when deployed in AWS ECS
I am building a Spring Boot application which consists of Spring Security and Thymeleaf. I have deployed this application in Elastic Container Service (ECS) cluster of AWS.
I have my simple controller ...
0
votes
1
answer
33
views
Thymeleaf throws an error when outputting the object id to the template
I have a object format, when I try to output to the id value, thymeleaf throws an error.
Spring Security dependency is also enabled.
Template code
<label th:each = "format : ${Format}" th:...
1
vote
0
answers
47
views
share authenticated user in whole app spring security
I am trying to build an application where users can post products.
Database looks like this :
user
--------
username
password
product
-------
name
price
idUser
I try to use spring security 6. ...
-2
votes
1
answer
283
views
Can't login error when using Spring security?
i am learning how to use spring security to build login function, i got the error as below "Invalid Username or Password" :
Caused by: java.lang.NullPointerException: Cannot invoke "...
1
vote
2
answers
234
views
Getting error while trying to authorise user with Spring Security
Trying to block access to a dropdown menu to unauthorized users using Spring Security (not owners and not admins), passing an "owner" object - the owner of the currently viewed list:
<...
0
votes
2
answers
1k
views
How can I configure logout functionality in spring security with thymeleaf?
I am new here I just want to know where I go wrong In configuring the Logout part in spring, I made a loging form form patient but when I try to logout it promt a 404 page.
Here is my Source Code.
...
0
votes
1
answer
59
views
Second hidden input is not read
I have two hidden input fields to implement Friend system. I pass user and friend's ids in Model and then use them in thymeleaf page to pass them in form to PostMapping and save changes. However, ...
0
votes
1
answer
422
views
Unexpected error (type=Forbidden, status=403) using csrf with Spring Security v3.0.0 and Thymeleaf
I try to configure security of my application but I get "Unexpected error (type=Forbidden, status=403)" and I don't know what is the problem. I register a user then login, do some stuff on a ...
1
vote
1
answer
240
views
Spring. One-time add session attributes after authorization
Stack: Spring Security and Thymeleaf.
I have the following problem: I want to show or not show some elements in all html templates depending on user's role.
So, I need a boolean variable "isAdmin&...
0
votes
0
answers
552
views
parsing multiple variables path from url in thymeleaf th:action
I am trying to get to the following URL in thyemleaf. This is basically a button that when clicked supposed to increment a value in the backend and turn a boolean value to true. Each of these path ...
0
votes
1
answer
53
views
How to display the user's nickname in the header
Actually, a more general question is how to display dynamic information loaded from the outside in an embedded page such as header and Footer.
I call a regular page using the controller and send ...
0
votes
1
answer
454
views
Can't load static resource with Thymeleaf
In my multi-module spring boot project I have included thymeleaf in the bo_ui module to show html pages.
Below what has been done so far.
MVC configuration class:
@Configuration
@EnableWebMvc
@...
2
votes
1
answer
1k
views
spring boot security prevent the logged in user from seeing the login and registration pages
I am using Thymeleaf in the interface layer. I want to prohibit login and register pages when user is logged in. Is there any solution to this?
@Override
protected void configure(HttpSecurity http)...
0
votes
1
answer
5k
views
Spring Security CSRF 403 Forbidden on successful login
I'm using Spring Security on a basic Thymeleaf setup with index.html and login.html, however the default login page always returns 403 Forbidden when the credentials are valid. (It gives a UI error ...
0
votes
1
answer
776
views
Spring security loginProcessingUrl only works on localhost
I have built an application by using Spring Boot and Thymeleaf. My application works as supposed in my localhost, but when I package it as a .war and deploy it in a test tomcat server, it prompts the ...
0
votes
1
answer
318
views
How to authorize html elements to specific users with sec:authorize with thymeleaf?
i would like for certain elements to show in front end for only certain users (not any user with certain role).
Why does this work:
<form sec:authorize="${principal.username.equals('A') }"...
1
vote
0
answers
518
views
How to specify content security policy with hash in spring security
I am using a java springboot application with thymeleaf and I want protect my app from non persistent xss by content security policy in spring security. Now, in my front end, none of the buttons work ...
2
votes
1
answer
1k
views
How do I resolve a Thymeleaf template to send in an email?
I am setting up email verification in a Spring Boot project of mine. I am following this tutorial from baeldung. I want to send an HTML email using a Thymeleaf template. After looking around the ...
0
votes
1
answer
269
views
Spring Security forgets authentication or requires multiple login attempts
I have a basic Spring Boot application secured by Spring Security and a form login. When I call a site which needs authentication, the login form appears, which is fine. But after I log in one of the ...
0
votes
1
answer
3k
views
SpringBoot Thymeleaf login redirect to index loads html but not css and js
I have a springboot application where I authenticate a user and if he is logged in I redirect him to the index.html. However, this index page just loads the plain .html and no js or css at all. I don'...
-1
votes
1
answer
109
views
Thymeleaf form sumbit button always returns null [duplicate]
I have the following login template:
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
<...
1
vote
0
answers
197
views
Java - Using Facebook Share Button Plugin in a Spring Boot Application With Thymeleaf and Spring Security
I am trying to dynamically share a page on facebook by using
th:data-href="'https://example.com/example/' + ${example.getId()}"
When this is shared it is a link to my sites login page which ...
2
votes
1
answer
2k
views
Displaying custom error messages in Spring Security?
I started to learn Spring 1 month ago and I'm doing some exercises with Spring Security. When a user logins into my app, the app check if the credentials are bad or less and if the account registered ...
1
vote
2
answers
5k
views
Logout doesn't work with Spring Boot, Spring Security and Thymleaf
I’m trying to add a logout function for our Spring Boot application but Spring logout does not work... The authenticated user still exists and it doesn’t clear the security context. What actually ...
0
votes
0
answers
252
views
Spring boot admin page - Security config - Java
im my web application, i have ad admin page.
the security config looks like this:
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests().antMatchers(
...
0
votes
1
answer
1k
views
SpringBoot show logout button for only users that are logged in without thymeleaf
I am currently looking for a solution on how to show the logout button only when a user is fully authenticated. This is for a personal project that I am doing. I want anonymous users to be able to ...
0
votes
2
answers
2k
views
http status 403 forbidden when uploading files [duplicate]
I am using Spring boot MultipartFile to allow users to upload their files and I want to save the uploaded files in the project directory or on my disk "C:\upload" (or wherever it works ...
1
vote
1
answer
685
views
Spring security does not go beyond login page
I am currently using thymeleaf, to implement my spring starter security.
What I am trying to acheive:
redirect to /userList after successful login
config file
@Configuration
@EnableWebSecurity
public ...
0
votes
1
answer
369
views
Mapping error Thymeleaf Spring Boot Security app, doesn't load templateS
This is my first time asking here, I'm concerned about this, so Im developing a web application using Spring Securirty and Spring boot, code seems to be fine and application runs, I only configured ...
1
vote
2
answers
38
views
Visability of static resourses in Thymeleaf with using Spring security
I have a directory hierarchy like this:
-resources
|
|-static
| |-css
| |-js
|-templates
|-error
|-fragments
And This cofigure:
@Override
protected void configure(HttpSecurity ...
0
votes
0
answers
186
views
Registration and authorization on one page (Java)
I need help. There is a page where the user can enter or register in the application. I do all this on one page and one view. If the registration works like an authorization, then the login refuses to ...
0
votes
1
answer
182
views
Using Posting a form with Spring Boot and Thymleaf incorrectly uses GET method instead of POST
I'm learning Spring Boot and am attempting to implement authentication. I have a signup page that uses a POST method to send new user data to be stored in an in-memory database. The weird thing that ...
1
vote
0
answers
427
views
How to make spring security make use of the existing tables by switching from in-memory
I have searched for this issue but cannot find any answer. I am new to spring framework. I have created an app which uses inMemory users. I want to switch and use the users I have created with the ...
0
votes
2
answers
3k
views
Spring security: how to turn off /logout for non-logged users?
I am building a spring security app. Login and logout are working fine, but I would like to make it impossible for non-logged users to logout which is possible by default (strange...).
I tried to add ...
2
votes
2
answers
903
views
Spring Security Thyemleaf page 403 after login using custom login page
Im setting up a Web Application using thymeleaf and spring security username and password authentication. After my login is successful im redirected to a url but Im getting a 403 on that page. Below ...
2
votes
1
answer
2k
views
sec:authorize does not work - Spring Boot 2, Thymeleaf 3, Thymeleaf Spring Security 5 integration package
I'm working with
Spring Boot 2.2.5
Thymeleaf 3.0.11
Thymeleaf Spring Security 5, 3.0.4 Release
I use the following dependencies in my pom.xml:
<dependency>
<groupId>org....
1
vote
0
answers
566
views
Access-Control-Allow-Origin' header in the response must not be the wildcard '*'
I have Spring Boot Application. I also use Spring Security and Thymeleaf.\
I have a piece of code where I get you tube videos from database and apply it in my thymeleaf template.
If I open dev tools ...
0
votes
3
answers
1k
views
Problem loading static resources in spring 5 with security enabled
I'm experience problems loading static resources like images, css styles, etc.... in spring 5
when I add security, without security it load ok
THis is how I done.
First, I create a project using ...
3
votes
1
answer
4k
views
Spring Security pages don't open in Iframe on Chrome
I am using Spring Boot, Spring Security and jdk 1.8. When I am trying to open any secured Thymleaf page in iframe on Chrome, then it is redirecting me to login page every time. It is working fine on ...
0
votes
1
answer
797
views
Spring Security and Thymeleaf with updated authentication
During one session I change user role with:
Authentication newAuth = new UsernamePasswordAuthenticationToken(newUser.geteMail(), newUser.getPassword(), AuthorityUtils.createAuthorityList(newUser....
0
votes
1
answer
947
views
Cannot access asset in spring-boot project due to spring security
I am facing quite an interesting issue. In my controller class I added path @RequestMapping("/product"). Inside class when I put a path on method like @GetMapping("/update/{productId}") that means ...
1
vote
0
answers
110
views
Spring, Thymeleaf redirect to the wrong controller
The problem is when i click on button (at homeHeader.html) which should redirect me to JobOfferController.java and then to > viewJobslist(), but it didn't happened because it redirect me to login page....
2
votes
2
answers
4k
views
java.lang.IllegalStateException:Current user principal is not of type when i try to integrate keycloak with spring boot web + spring security project
I Created a spring boot web project (.war) to be deployed in an application server.I want to integrate keycloak sso with spring security.The redirection to keycloak login page is working fine. But ...
1
vote
1
answer
2k
views
How to make the initial landing page is not the login form from spring security?
Currently, I am using spring-security with a custom login page. Whenever I start my app, it always landed on my login page first instead of home in not login state. I want to make my initial landing ...
1
vote
1
answer
272
views
TemplateInputException: Error resolving template [auth/login]
i faced this problem , when i send request with invalid user credentials.
If user credentials are valid , everything works normal.
Controller
@RestController
@RequestMapping(value = "/auth/")
public ...