是否可以在具有 spring 安全性的 webflux 应用程序中使用 "username" 在 ldap 上使用绑定进行身份验证,就像在 php 中一样?
Is it possible to authenticate with bind on ldap using the "username" in a webflux application with spring security like in php?
我在 google 上搜索过,但我总是只找到使用 dn 的方法,但对于登录,我没有 dn,用户名也不是 dn 的一部分。我还查看了代码和我遇到的各种不同的错误,但到目前为止我一无所获。
2020-03-11 12:21:26.718 TRACE 26996 --- [ctor-http-nio-2] o.s.w.s.adapter.HttpWebHandlerAdapter : [0b7f4a17] Completed 302 FOUND, headers={masked}
2020-03-11 12:21:26.719 TRACE 26996 --- [ctor-http-nio-2] o.s.h.s.r.ReactorHttpHandlerAdapter : [0b7f4a17] Handling completed
2020-03-11 12:21:26.730 TRACE 26996 --- [ctor-http-nio-2] o.s.w.s.adapter.HttpWebHandlerAdapter : [0b7f4a17] HTTP GET "/login", headers={masked}
2020-03-11 12:21:26.734 TRACE 26996 --- [ctor-http-nio-2] o.s.w.s.adapter.HttpWebHandlerAdapter : [0b7f4a17] Completed 200 OK, headers={masked}
2020-03-11 12:21:26.734 TRACE 26996 --- [ctor-http-nio-2] o.s.h.s.r.ReactorHttpHandlerAdapter : [0b7f4a17] Handling completed
2020-03-11 12:21:27.331 TRACE 26996 --- [ctor-http-nio-2] o.s.w.s.adapter.HttpWebHandlerAdapter : [0b7f4a17] HTTP GET "/favicon.ico", headers={masked}
2020-03-11 12:21:27.336 TRACE 26996 --- [ctor-http-nio-2] o.s.w.s.adapter.HttpWebHandlerAdapter : [0b7f4a17] Completed 302 FOUND, headers={masked}
2020-03-11 12:21:27.337 TRACE 26996 --- [ctor-http-nio-2] o.s.h.s.r.ReactorHttpHandlerAdapter : [0b7f4a17] Handling completed
2020-03-11 12:21:27.341 TRACE 26996 --- [ctor-http-nio-2] o.s.w.s.adapter.HttpWebHandlerAdapter : [0b7f4a17] HTTP GET "/login", headers={masked}
2020-03-11 12:21:27.345 TRACE 26996 --- [ctor-http-nio-2] o.s.w.s.adapter.HttpWebHandlerAdapter : [0b7f4a17] Completed 200 OK, headers={masked}
2020-03-11 12:21:27.345 TRACE 26996 --- [ctor-http-nio-2] o.s.h.s.r.ReactorHttpHandlerAdapter : [0b7f4a17] Handling completed
2020-03-11 12:22:33.067 TRACE 26996 --- [ctor-http-nio-2] o.s.w.s.adapter.HttpWebHandlerAdapter : [0b7f4a17] HTTP POST "/login", headers={masked}
2020-03-11 12:22:33.092 TRACE 26996 --- [ctor-http-nio-2] o.s.http.codec.FormHttpMessageReader : [0b7f4a17] Read form fields [username, password, _csrf] (content masked)
2020-03-11 12:22:33.103 DEBUG 26996 --- [oundedElastic-1] o.s.s.authentication.ProviderManager : Authentication attempt using org.springframework.security.ldap.authentication.LdapAuthenticationProvider
2020-03-11 12:22:33.106 DEBUG 26996 --- [oundedElastic-1] o.s.s.l.a.LdapAuthenticationProvider : Processing authentication request for user: <username that worked in php>
2020-03-11 12:22:33.131 TRACE 26996 --- [oundedElastic-1] o.s.w.s.adapter.HttpWebHandlerAdapter : [0b7f4a17] Completed 302 FOUND, headers={masked}
2020-03-11 12:22:33.132 TRACE 26996 --- [oundedElastic-1] o.s.h.s.r.ReactorHttpHandlerAdapter : [0b7f4a17] Handling completed
2020-03-11 12:22:33.142 TRACE 26996 --- [ctor-http-nio-2] o.s.w.s.adapter.HttpWebHandlerAdapter : [0b7f4a17] HTTP GET "/login?error", headers={masked}
2020-03-11 12:22:33.146 TRACE 26996 --- [ctor-http-nio-2] o.s.w.s.adapter.HttpWebHandlerAdapter : [0b7f4a17] Completed 200 OK, headers={masked}
2020-03-11 12:22:33.146 TRACE 26996 --- [ctor-http-nio-2] o.s.h.s.r.ReactorHttpHandlerAdapter : [0b7f4a17] Handling completed
这是我尝试登录时启用跟踪的日志输出。
我知道怎么做了!我需要使用 ActiveDirectoryLdapAuthenticationProvider
而不是 LdapAuthenticationProvider
和 BindAuthenticator
.
我在 google 上搜索过,但我总是只找到使用 dn 的方法,但对于登录,我没有 dn,用户名也不是 dn 的一部分。我还查看了代码和我遇到的各种不同的错误,但到目前为止我一无所获。
2020-03-11 12:21:26.718 TRACE 26996 --- [ctor-http-nio-2] o.s.w.s.adapter.HttpWebHandlerAdapter : [0b7f4a17] Completed 302 FOUND, headers={masked}
2020-03-11 12:21:26.719 TRACE 26996 --- [ctor-http-nio-2] o.s.h.s.r.ReactorHttpHandlerAdapter : [0b7f4a17] Handling completed
2020-03-11 12:21:26.730 TRACE 26996 --- [ctor-http-nio-2] o.s.w.s.adapter.HttpWebHandlerAdapter : [0b7f4a17] HTTP GET "/login", headers={masked}
2020-03-11 12:21:26.734 TRACE 26996 --- [ctor-http-nio-2] o.s.w.s.adapter.HttpWebHandlerAdapter : [0b7f4a17] Completed 200 OK, headers={masked}
2020-03-11 12:21:26.734 TRACE 26996 --- [ctor-http-nio-2] o.s.h.s.r.ReactorHttpHandlerAdapter : [0b7f4a17] Handling completed
2020-03-11 12:21:27.331 TRACE 26996 --- [ctor-http-nio-2] o.s.w.s.adapter.HttpWebHandlerAdapter : [0b7f4a17] HTTP GET "/favicon.ico", headers={masked}
2020-03-11 12:21:27.336 TRACE 26996 --- [ctor-http-nio-2] o.s.w.s.adapter.HttpWebHandlerAdapter : [0b7f4a17] Completed 302 FOUND, headers={masked}
2020-03-11 12:21:27.337 TRACE 26996 --- [ctor-http-nio-2] o.s.h.s.r.ReactorHttpHandlerAdapter : [0b7f4a17] Handling completed
2020-03-11 12:21:27.341 TRACE 26996 --- [ctor-http-nio-2] o.s.w.s.adapter.HttpWebHandlerAdapter : [0b7f4a17] HTTP GET "/login", headers={masked}
2020-03-11 12:21:27.345 TRACE 26996 --- [ctor-http-nio-2] o.s.w.s.adapter.HttpWebHandlerAdapter : [0b7f4a17] Completed 200 OK, headers={masked}
2020-03-11 12:21:27.345 TRACE 26996 --- [ctor-http-nio-2] o.s.h.s.r.ReactorHttpHandlerAdapter : [0b7f4a17] Handling completed
2020-03-11 12:22:33.067 TRACE 26996 --- [ctor-http-nio-2] o.s.w.s.adapter.HttpWebHandlerAdapter : [0b7f4a17] HTTP POST "/login", headers={masked}
2020-03-11 12:22:33.092 TRACE 26996 --- [ctor-http-nio-2] o.s.http.codec.FormHttpMessageReader : [0b7f4a17] Read form fields [username, password, _csrf] (content masked)
2020-03-11 12:22:33.103 DEBUG 26996 --- [oundedElastic-1] o.s.s.authentication.ProviderManager : Authentication attempt using org.springframework.security.ldap.authentication.LdapAuthenticationProvider
2020-03-11 12:22:33.106 DEBUG 26996 --- [oundedElastic-1] o.s.s.l.a.LdapAuthenticationProvider : Processing authentication request for user: <username that worked in php>
2020-03-11 12:22:33.131 TRACE 26996 --- [oundedElastic-1] o.s.w.s.adapter.HttpWebHandlerAdapter : [0b7f4a17] Completed 302 FOUND, headers={masked}
2020-03-11 12:22:33.132 TRACE 26996 --- [oundedElastic-1] o.s.h.s.r.ReactorHttpHandlerAdapter : [0b7f4a17] Handling completed
2020-03-11 12:22:33.142 TRACE 26996 --- [ctor-http-nio-2] o.s.w.s.adapter.HttpWebHandlerAdapter : [0b7f4a17] HTTP GET "/login?error", headers={masked}
2020-03-11 12:22:33.146 TRACE 26996 --- [ctor-http-nio-2] o.s.w.s.adapter.HttpWebHandlerAdapter : [0b7f4a17] Completed 200 OK, headers={masked}
2020-03-11 12:22:33.146 TRACE 26996 --- [ctor-http-nio-2] o.s.h.s.r.ReactorHttpHandlerAdapter : [0b7f4a17] Handling completed
这是我尝试登录时启用跟踪的日志输出。
我知道怎么做了!我需要使用 ActiveDirectoryLdapAuthenticationProvider
而不是 LdapAuthenticationProvider
和 BindAuthenticator
.