简体   繁体   English

使用Spring云网关进行Ldap身份验证

[英]Ldap authentication with spring cloud gateway

I am trying to set up a new server that acts as a gateway (using spring-cloud-gateway as a base) and I need to be able to authenticate users via a remote LDAP server before actually forwarding any subsequent requests. 我正在尝试建立一个充当网关的新服务器(使用spring-cloud-gateway作为基础),我需要能够在实际转发任何后续请求之前通过远程LDAP服务器对用户进行身份验证。 How would I go about implementing this (packages, configuration, etc)? 我将如何实现这个(包,配置等)?

This should be fairly straight forward to explain. 这应该是相当直接的解释。 There are two concerns here: 这里有两个问题:

  • Spring Cloud Gateway Spring Cloud Gateway
  • Spring Security (LDAP) Spring Security(LDAP)

Think of the gateway segment is like any other part of a web-application. 可以认为网关段与Web应用程序的任何其他部分一样。 Don't so much worry about that part. 不要担心那部分。

As far as getting spring-security + LDAP, you'll have to get that part worked out and configured as per your requirements then just make sure that the spring-cloud-gateway functionality is caught underneath the authentication filter. 至于获得spring-security + LDAP,你必须根据你的要求制定和配置那部分,然后确保在认证过滤器下面捕获spring-cloud-gateway功能。

If you're using spring-boot, probably would need the starters for sgc and spring-security. 如果您使用的是spring-boot,可能需要sgc和spring-security的启动器。 They should be fairly well documented and straight forward to configure. 它们应该有相当好的文档并且可以直接配置。

The LDAP functionality in spring-security is very mature and should be easy enough to configure with little effort. spring-security中的LDAP功能非常成熟,应该很容易配置,只需很少的工作量。 Most of the functionality underpinning that (LDAP) is all implemented via the JRE. 支持(LDAP)的大部分功能都是通过JRE实现的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM