Http basic authentication using ldap credentials in spring security(spring-boot project) to secure rest service calls -



Http basic authentication using ldap credentials in spring security(spring-boot project) to secure rest service calls -

using spring security basic authentication setup works against hardcoded username passwords shown here:

http://thoughtfulsoftware.wordpress.com/2013/12/08/adding-security-to-spring-guides-rest-service/

so trying extend utilize ldap.

completed set ldap authentication our ldap server

now when seek phone call rest service through rest console plug-in authorization window keeps on popping username password. if cancel authorization fails, not sure going wrong

@configuration @enablewebsecurity @enableglobalmethodsecurity(securedenabled = true) public class securityconfig extends websecurityconfigureradapter { @override protected void configure(httpsecurity http) throws exception {http .authorizerequests() .anyrequest().authenticated() .and() .csrf().disable() .httpbasic(); @override protected void configure(authenticationmanagerbuilder authmanagerbuilder) throws exception { authmanagerbuilder .ldapauthentication() .usersearchfilter("(uid={0})").usersearchbase("ou=people,dc=zzz,dc=xxxx,dc=yyy") .grouproleattribute("cn").groupsearchfilter("(member={0})") //.userdnpatterns("uid={0},ou=people") //.groupsearchbase("ou=groups") .contextsource().url("ldaps://ldap.xxxx.yyy:636/cn=cw-grpreader,ou=people,dc=xxx,dc=xxxx,dc=xxx") .managerdn("cn=xx-xxr,ou=people,dc=med,dc=xxxx,dc=xxx") .managerpassword("#$%^^"); }

this 1 way tried give recurring authentication popup if cancel popup http status 401 - [ldap: error code 49 - nds error: failed authentication (-669)]; error if credentials right link tutorial helpful

this due httpbasic authentication have set up. spring boot generates random password thats shown on console use.

to disable pop-up add together application.properties file.

security.basic.enabled: false

spring-security ldap basic-authentication spring-boot

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -