springboot - 基本的 ActiveDirectory 身份验证,然后是 JWT 令牌

有没有人在 springboot 应用程序中有这样的工作示例?

  1. /auth 控制器,用户在其中提供 ActiveDirectory 凭据(通过基本身份验证或 POST json)并在他们提供有效的 AD 凭据时接收 JWT 令牌。不应涉及 LDIF 文件,Springboot 应用程序将根据 ldaps://ActiveDirectoryhost:636 端点验证凭据

  2. /myapi 控制器仅在来自第 1 步(以上)的有效 JWT 令牌以“授权承载”标题发送时才有效

我没有找到任何具有此设置的示例博客/指南,但我相信这将是一个常见的安全设置,除非我弄错了?不应该涉及 jpa/hibernate/persistence/mysql/postgres/H2db 连接我在网上找到的所有示例要么只是 JWT,要么只是 LDAP,或者使用 LDIF 或使用一些 H2/postgres 来存储凭据。


慕田峪7331174
浏览 287回答 1
1回答

慕莱坞森

这有效:JWT 来自https://github.com/merugu/springsecurity/tree/master/ldapauthenticationjwttoken来自https://medium.com/@dmarko484/spring-boot-active-directory-authentication-5ea04969f220 的广告必须将 github jwt repo 升级到 springboot 2.0.5 并添加 setSearchFilter {1} ( https://docs.spring.io/spring-security/site/docs/current/api/org/springframework/security/ldap/authentication /ad/ActiveDirectoryLdapAuthenticationProvider.html ) 到 AD:这第二个选项也工作Springboot 1.5 春季安全开关,LDAP认证和数据库权限(https://stackoverflow.com/a/34658755之上)https://github.com/cnapagoda/spring-boot-basic-授权
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java