Multiple markers at this line
- Syntax error on token ".", delete this token
- Syntax error, insert ")" to complete Expression
- The method passwordEncoder(BCryptPasswordEncoder) is undefined for the type
WebConfigur
Uploaded my code to github if it makes it easier to see the problem.
Well, your latest problem is caused by the fact that you didn't write valid Java code: You didn't using a closing parenthesis for the passwordEncoder() method.
However, calling passwordEncoder() won't fix your original problem.
This issue is caused by Spring 5 using a default password encoder, whereas Spring 4 just stored passwords as plaintext by default. The password() method expects you to pass it a password in encoded form, not in plaintext form. So what you need to do is get the encoder that Spring is already using, and use it to encode the password that you pass to the password() method.
Thank you for the explanation and I made the change you told me to and did not get any visible error but when I started the project I got this error trace:
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project webapp: Compilation failure
[ERROR] /Users//Downloads/webapp/src/main/java/config/WebConfigur.java:[24,9] cannot find symbol
[ERROR] symbol: class var
[ERROR] location: class config.WebConfigur
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
var is a special identifier that was added in Java 10. If your compiler reports that it can't find the symbol var, it means that you're on an older Java version. The solution is to use the formal type name instead of the identifier var.
Hi Martin,
So, when you log on as emma , you got a 403 Forbidden error?
Is your method or class annotated with either @Secured(ROLE_BOSS) or @Secured (ROLE_DEV) ?
But putting this annotation, it means the class or method can only permit BOSS or DEV to access.
I get to the spring default login form and i can only login with the generated password. Do I have to create a login html file too or can the default password be replaced without creating a login form.