authentication spring security











up vote
0
down vote

favorite












i'm trying to authenticate with spring security and jsf but it doesn't work, when i put my authentication information don't pass.
i tried some solutions and here is one of theme, this is my first time configuring jsf,spring security



there is my code:



@Configuration
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
private UserDetailsService userDetailsService;

@Autowired
public void configurationGlobal(AuthenticationManagerBuilder auth) throws Exception {
auth.inMemoryAuthentication().withUser("admin").password("admin").roles("ADMIN");
// auth.userDetailsService(userDetailsService).passwordEncoder(passwordEncoder());
}

@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable().
authorizeRequests()
.anyRequest()
.authenticated()
.and()
.formLogin()
.loginPage("/login.xhtml").loginProcessingUrl("login").failureUrl("/login.xhtml?error=true")
.permitAll()
.defaultSuccessUrl("/index.xhtml");

}

@Bean
public BCryptPasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
};
}


this is my login page



      <form action="${request.contextPath}/login" method="POST">
<h:outputLabel value="Enter UserName:" />
<input type="text" name="username"/><br/><br/>
<h:outputLabel value="Enter Password:" />
<input type="password" name="password"/> <br/><br/>
<input type="submit" value="Login"/>
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
</form>


faces-config.xml



  <?xml version='1.0' encoding='UTF-8'?>
<faces-config version="2.2"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd">
<application>
<el-resolver>
org.springframework.web.jsf.el.SpringBeanFacesELResolver
</el-resolver>
</application>
</faces-config>


and this is my web.xml



  <?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>faces/index.xhtml</welcome-file>
</welcome-file-list>
<listener>
<listener-class>
org.springframework.web.context.request.RequestContextListener
</listener-class>
</listener>
</web-app>









share|improve this question
























  • There is nothing jsf related in this question... Care to elaborate why you think your problem is jsf related?
    – Kukeltje
    Nov 11 at 18:59










  • i'm using jsf but with authentication i found this as a solution that's way i put it here and i try it but didn't work
    – yassine chafaaoui
    Nov 12 at 18:29










  • This is not a spring jsf solution. It is plain jsp/spring/el. I think you misinterpreted a tutorial somewhere.
    – Kukeltje
    Nov 12 at 18:34










  • i was looking for a solution, i will put the jsf configuration
    – yassine chafaaoui
    Nov 12 at 18:35










  • sorry for not being clear form the beging
    – yassine chafaaoui
    Nov 12 at 18:44















up vote
0
down vote

favorite












i'm trying to authenticate with spring security and jsf but it doesn't work, when i put my authentication information don't pass.
i tried some solutions and here is one of theme, this is my first time configuring jsf,spring security



there is my code:



@Configuration
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
private UserDetailsService userDetailsService;

@Autowired
public void configurationGlobal(AuthenticationManagerBuilder auth) throws Exception {
auth.inMemoryAuthentication().withUser("admin").password("admin").roles("ADMIN");
// auth.userDetailsService(userDetailsService).passwordEncoder(passwordEncoder());
}

@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable().
authorizeRequests()
.anyRequest()
.authenticated()
.and()
.formLogin()
.loginPage("/login.xhtml").loginProcessingUrl("login").failureUrl("/login.xhtml?error=true")
.permitAll()
.defaultSuccessUrl("/index.xhtml");

}

@Bean
public BCryptPasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
};
}


this is my login page



      <form action="${request.contextPath}/login" method="POST">
<h:outputLabel value="Enter UserName:" />
<input type="text" name="username"/><br/><br/>
<h:outputLabel value="Enter Password:" />
<input type="password" name="password"/> <br/><br/>
<input type="submit" value="Login"/>
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
</form>


faces-config.xml



  <?xml version='1.0' encoding='UTF-8'?>
<faces-config version="2.2"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd">
<application>
<el-resolver>
org.springframework.web.jsf.el.SpringBeanFacesELResolver
</el-resolver>
</application>
</faces-config>


and this is my web.xml



  <?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>faces/index.xhtml</welcome-file>
</welcome-file-list>
<listener>
<listener-class>
org.springframework.web.context.request.RequestContextListener
</listener-class>
</listener>
</web-app>









share|improve this question
























  • There is nothing jsf related in this question... Care to elaborate why you think your problem is jsf related?
    – Kukeltje
    Nov 11 at 18:59










  • i'm using jsf but with authentication i found this as a solution that's way i put it here and i try it but didn't work
    – yassine chafaaoui
    Nov 12 at 18:29










  • This is not a spring jsf solution. It is plain jsp/spring/el. I think you misinterpreted a tutorial somewhere.
    – Kukeltje
    Nov 12 at 18:34










  • i was looking for a solution, i will put the jsf configuration
    – yassine chafaaoui
    Nov 12 at 18:35










  • sorry for not being clear form the beging
    – yassine chafaaoui
    Nov 12 at 18:44













up vote
0
down vote

favorite









up vote
0
down vote

favorite











i'm trying to authenticate with spring security and jsf but it doesn't work, when i put my authentication information don't pass.
i tried some solutions and here is one of theme, this is my first time configuring jsf,spring security



there is my code:



@Configuration
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
private UserDetailsService userDetailsService;

@Autowired
public void configurationGlobal(AuthenticationManagerBuilder auth) throws Exception {
auth.inMemoryAuthentication().withUser("admin").password("admin").roles("ADMIN");
// auth.userDetailsService(userDetailsService).passwordEncoder(passwordEncoder());
}

@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable().
authorizeRequests()
.anyRequest()
.authenticated()
.and()
.formLogin()
.loginPage("/login.xhtml").loginProcessingUrl("login").failureUrl("/login.xhtml?error=true")
.permitAll()
.defaultSuccessUrl("/index.xhtml");

}

@Bean
public BCryptPasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
};
}


this is my login page



      <form action="${request.contextPath}/login" method="POST">
<h:outputLabel value="Enter UserName:" />
<input type="text" name="username"/><br/><br/>
<h:outputLabel value="Enter Password:" />
<input type="password" name="password"/> <br/><br/>
<input type="submit" value="Login"/>
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
</form>


faces-config.xml



  <?xml version='1.0' encoding='UTF-8'?>
<faces-config version="2.2"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd">
<application>
<el-resolver>
org.springframework.web.jsf.el.SpringBeanFacesELResolver
</el-resolver>
</application>
</faces-config>


and this is my web.xml



  <?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>faces/index.xhtml</welcome-file>
</welcome-file-list>
<listener>
<listener-class>
org.springframework.web.context.request.RequestContextListener
</listener-class>
</listener>
</web-app>









share|improve this question















i'm trying to authenticate with spring security and jsf but it doesn't work, when i put my authentication information don't pass.
i tried some solutions and here is one of theme, this is my first time configuring jsf,spring security



there is my code:



@Configuration
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
private UserDetailsService userDetailsService;

@Autowired
public void configurationGlobal(AuthenticationManagerBuilder auth) throws Exception {
auth.inMemoryAuthentication().withUser("admin").password("admin").roles("ADMIN");
// auth.userDetailsService(userDetailsService).passwordEncoder(passwordEncoder());
}

@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable().
authorizeRequests()
.anyRequest()
.authenticated()
.and()
.formLogin()
.loginPage("/login.xhtml").loginProcessingUrl("login").failureUrl("/login.xhtml?error=true")
.permitAll()
.defaultSuccessUrl("/index.xhtml");

}

@Bean
public BCryptPasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
};
}


this is my login page



      <form action="${request.contextPath}/login" method="POST">
<h:outputLabel value="Enter UserName:" />
<input type="text" name="username"/><br/><br/>
<h:outputLabel value="Enter Password:" />
<input type="password" name="password"/> <br/><br/>
<input type="submit" value="Login"/>
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"/>
</form>


faces-config.xml



  <?xml version='1.0' encoding='UTF-8'?>
<faces-config version="2.2"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd">
<application>
<el-resolver>
org.springframework.web.jsf.el.SpringBeanFacesELResolver
</el-resolver>
</application>
</faces-config>


and this is my web.xml



  <?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>faces/index.xhtml</welcome-file>
</welcome-file-list>
<listener>
<listener-class>
org.springframework.web.context.request.RequestContextListener
</listener-class>
</listener>
</web-app>






spring spring-security






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 12 at 19:53









Kukeltje

8,74641338




8,74641338










asked Nov 11 at 16:35









yassine chafaaoui

12




12












  • There is nothing jsf related in this question... Care to elaborate why you think your problem is jsf related?
    – Kukeltje
    Nov 11 at 18:59










  • i'm using jsf but with authentication i found this as a solution that's way i put it here and i try it but didn't work
    – yassine chafaaoui
    Nov 12 at 18:29










  • This is not a spring jsf solution. It is plain jsp/spring/el. I think you misinterpreted a tutorial somewhere.
    – Kukeltje
    Nov 12 at 18:34










  • i was looking for a solution, i will put the jsf configuration
    – yassine chafaaoui
    Nov 12 at 18:35










  • sorry for not being clear form the beging
    – yassine chafaaoui
    Nov 12 at 18:44


















  • There is nothing jsf related in this question... Care to elaborate why you think your problem is jsf related?
    – Kukeltje
    Nov 11 at 18:59










  • i'm using jsf but with authentication i found this as a solution that's way i put it here and i try it but didn't work
    – yassine chafaaoui
    Nov 12 at 18:29










  • This is not a spring jsf solution. It is plain jsp/spring/el. I think you misinterpreted a tutorial somewhere.
    – Kukeltje
    Nov 12 at 18:34










  • i was looking for a solution, i will put the jsf configuration
    – yassine chafaaoui
    Nov 12 at 18:35










  • sorry for not being clear form the beging
    – yassine chafaaoui
    Nov 12 at 18:44
















There is nothing jsf related in this question... Care to elaborate why you think your problem is jsf related?
– Kukeltje
Nov 11 at 18:59




There is nothing jsf related in this question... Care to elaborate why you think your problem is jsf related?
– Kukeltje
Nov 11 at 18:59












i'm using jsf but with authentication i found this as a solution that's way i put it here and i try it but didn't work
– yassine chafaaoui
Nov 12 at 18:29




i'm using jsf but with authentication i found this as a solution that's way i put it here and i try it but didn't work
– yassine chafaaoui
Nov 12 at 18:29












This is not a spring jsf solution. It is plain jsp/spring/el. I think you misinterpreted a tutorial somewhere.
– Kukeltje
Nov 12 at 18:34




This is not a spring jsf solution. It is plain jsp/spring/el. I think you misinterpreted a tutorial somewhere.
– Kukeltje
Nov 12 at 18:34












i was looking for a solution, i will put the jsf configuration
– yassine chafaaoui
Nov 12 at 18:35




i was looking for a solution, i will put the jsf configuration
– yassine chafaaoui
Nov 12 at 18:35












sorry for not being clear form the beging
– yassine chafaaoui
Nov 12 at 18:44




sorry for not being clear form the beging
– yassine chafaaoui
Nov 12 at 18:44












2 Answers
2






active

oldest

votes

















up vote
0
down vote













Spring boot is a standalone server, JSF is a WEB frontend framework. The first you should integrate both. For easy start use https://github.com/joinfaces/joinfaces .






share|improve this answer





















  • There is no requirement to use springboot with JSF. You can use them separately.
    – Kukeltje
    Nov 12 at 10:27










  • Of course JSF by itself does not need Spring or Spring boot. Sprig boot can be used as a backend service, but also possible integrate JSF with Spring and deploy under Tomcat or integrate JSF with Spring boot and run as standalone web application.
    – Armen Arzumanyan
    Nov 14 at 20:02


















up vote
-1
down vote



accepted










i solve the problème by removing passwordEncoder



 @Bean
public BCryptPasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
};


and because i'm using spring security 5 i added {noop} before my password like this



 auth.inMemoryAuthentication().withUser("admin").password("{noop}admin").roles("ADMIN");





share|improve this answer





















  • Great you solved it, but still nothing jsf related in the question (posting a faces config does not make jsf part of the problem) nor in the answer. And not using a pw encoder seems dangerous
    – Kukeltje
    Nov 12 at 19:56












  • the problem i was doing the some thing before with spring MVC and every things work when i try it with jsf a get the problem that's way i thought that was JSF problem and thank you for -1
    – yassine chafaaoui
    Nov 13 at 13:03










  • The -1 is not mine, although I think the solution of not using a passwordencoder is very bad and this should not be the answer to your problem)
    – Kukeltje
    Nov 13 at 13:10













Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53250838%2fauthentication-spring-security%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote













Spring boot is a standalone server, JSF is a WEB frontend framework. The first you should integrate both. For easy start use https://github.com/joinfaces/joinfaces .






share|improve this answer





















  • There is no requirement to use springboot with JSF. You can use them separately.
    – Kukeltje
    Nov 12 at 10:27










  • Of course JSF by itself does not need Spring or Spring boot. Sprig boot can be used as a backend service, but also possible integrate JSF with Spring and deploy under Tomcat or integrate JSF with Spring boot and run as standalone web application.
    – Armen Arzumanyan
    Nov 14 at 20:02















up vote
0
down vote













Spring boot is a standalone server, JSF is a WEB frontend framework. The first you should integrate both. For easy start use https://github.com/joinfaces/joinfaces .






share|improve this answer





















  • There is no requirement to use springboot with JSF. You can use them separately.
    – Kukeltje
    Nov 12 at 10:27










  • Of course JSF by itself does not need Spring or Spring boot. Sprig boot can be used as a backend service, but also possible integrate JSF with Spring and deploy under Tomcat or integrate JSF with Spring boot and run as standalone web application.
    – Armen Arzumanyan
    Nov 14 at 20:02













up vote
0
down vote










up vote
0
down vote









Spring boot is a standalone server, JSF is a WEB frontend framework. The first you should integrate both. For easy start use https://github.com/joinfaces/joinfaces .






share|improve this answer












Spring boot is a standalone server, JSF is a WEB frontend framework. The first you should integrate both. For easy start use https://github.com/joinfaces/joinfaces .







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 11 at 20:27









Armen Arzumanyan

82611537




82611537












  • There is no requirement to use springboot with JSF. You can use them separately.
    – Kukeltje
    Nov 12 at 10:27










  • Of course JSF by itself does not need Spring or Spring boot. Sprig boot can be used as a backend service, but also possible integrate JSF with Spring and deploy under Tomcat or integrate JSF with Spring boot and run as standalone web application.
    – Armen Arzumanyan
    Nov 14 at 20:02


















  • There is no requirement to use springboot with JSF. You can use them separately.
    – Kukeltje
    Nov 12 at 10:27










  • Of course JSF by itself does not need Spring or Spring boot. Sprig boot can be used as a backend service, but also possible integrate JSF with Spring and deploy under Tomcat or integrate JSF with Spring boot and run as standalone web application.
    – Armen Arzumanyan
    Nov 14 at 20:02
















There is no requirement to use springboot with JSF. You can use them separately.
– Kukeltje
Nov 12 at 10:27




There is no requirement to use springboot with JSF. You can use them separately.
– Kukeltje
Nov 12 at 10:27












Of course JSF by itself does not need Spring or Spring boot. Sprig boot can be used as a backend service, but also possible integrate JSF with Spring and deploy under Tomcat or integrate JSF with Spring boot and run as standalone web application.
– Armen Arzumanyan
Nov 14 at 20:02




Of course JSF by itself does not need Spring or Spring boot. Sprig boot can be used as a backend service, but also possible integrate JSF with Spring and deploy under Tomcat or integrate JSF with Spring boot and run as standalone web application.
– Armen Arzumanyan
Nov 14 at 20:02












up vote
-1
down vote



accepted










i solve the problème by removing passwordEncoder



 @Bean
public BCryptPasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
};


and because i'm using spring security 5 i added {noop} before my password like this



 auth.inMemoryAuthentication().withUser("admin").password("{noop}admin").roles("ADMIN");





share|improve this answer





















  • Great you solved it, but still nothing jsf related in the question (posting a faces config does not make jsf part of the problem) nor in the answer. And not using a pw encoder seems dangerous
    – Kukeltje
    Nov 12 at 19:56












  • the problem i was doing the some thing before with spring MVC and every things work when i try it with jsf a get the problem that's way i thought that was JSF problem and thank you for -1
    – yassine chafaaoui
    Nov 13 at 13:03










  • The -1 is not mine, although I think the solution of not using a passwordencoder is very bad and this should not be the answer to your problem)
    – Kukeltje
    Nov 13 at 13:10

















up vote
-1
down vote



accepted










i solve the problème by removing passwordEncoder



 @Bean
public BCryptPasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
};


and because i'm using spring security 5 i added {noop} before my password like this



 auth.inMemoryAuthentication().withUser("admin").password("{noop}admin").roles("ADMIN");





share|improve this answer





















  • Great you solved it, but still nothing jsf related in the question (posting a faces config does not make jsf part of the problem) nor in the answer. And not using a pw encoder seems dangerous
    – Kukeltje
    Nov 12 at 19:56












  • the problem i was doing the some thing before with spring MVC and every things work when i try it with jsf a get the problem that's way i thought that was JSF problem and thank you for -1
    – yassine chafaaoui
    Nov 13 at 13:03










  • The -1 is not mine, although I think the solution of not using a passwordencoder is very bad and this should not be the answer to your problem)
    – Kukeltje
    Nov 13 at 13:10















up vote
-1
down vote



accepted







up vote
-1
down vote



accepted






i solve the problème by removing passwordEncoder



 @Bean
public BCryptPasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
};


and because i'm using spring security 5 i added {noop} before my password like this



 auth.inMemoryAuthentication().withUser("admin").password("{noop}admin").roles("ADMIN");





share|improve this answer












i solve the problème by removing passwordEncoder



 @Bean
public BCryptPasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
};


and because i'm using spring security 5 i added {noop} before my password like this



 auth.inMemoryAuthentication().withUser("admin").password("{noop}admin").roles("ADMIN");






share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 12 at 19:21









yassine chafaaoui

12




12












  • Great you solved it, but still nothing jsf related in the question (posting a faces config does not make jsf part of the problem) nor in the answer. And not using a pw encoder seems dangerous
    – Kukeltje
    Nov 12 at 19:56












  • the problem i was doing the some thing before with spring MVC and every things work when i try it with jsf a get the problem that's way i thought that was JSF problem and thank you for -1
    – yassine chafaaoui
    Nov 13 at 13:03










  • The -1 is not mine, although I think the solution of not using a passwordencoder is very bad and this should not be the answer to your problem)
    – Kukeltje
    Nov 13 at 13:10




















  • Great you solved it, but still nothing jsf related in the question (posting a faces config does not make jsf part of the problem) nor in the answer. And not using a pw encoder seems dangerous
    – Kukeltje
    Nov 12 at 19:56












  • the problem i was doing the some thing before with spring MVC and every things work when i try it with jsf a get the problem that's way i thought that was JSF problem and thank you for -1
    – yassine chafaaoui
    Nov 13 at 13:03










  • The -1 is not mine, although I think the solution of not using a passwordencoder is very bad and this should not be the answer to your problem)
    – Kukeltje
    Nov 13 at 13:10


















Great you solved it, but still nothing jsf related in the question (posting a faces config does not make jsf part of the problem) nor in the answer. And not using a pw encoder seems dangerous
– Kukeltje
Nov 12 at 19:56






Great you solved it, but still nothing jsf related in the question (posting a faces config does not make jsf part of the problem) nor in the answer. And not using a pw encoder seems dangerous
– Kukeltje
Nov 12 at 19:56














the problem i was doing the some thing before with spring MVC and every things work when i try it with jsf a get the problem that's way i thought that was JSF problem and thank you for -1
– yassine chafaaoui
Nov 13 at 13:03




the problem i was doing the some thing before with spring MVC and every things work when i try it with jsf a get the problem that's way i thought that was JSF problem and thank you for -1
– yassine chafaaoui
Nov 13 at 13:03












The -1 is not mine, although I think the solution of not using a passwordencoder is very bad and this should not be the answer to your problem)
– Kukeltje
Nov 13 at 13:10






The -1 is not mine, although I think the solution of not using a passwordencoder is very bad and this should not be the answer to your problem)
– Kukeltje
Nov 13 at 13:10




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53250838%2fauthentication-spring-security%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Coverage of Google Street View

Full-time equivalent

Surfing