
[英]Why antMatchers not working and trying to authenticate Login route?
我在 spring 安全性中进行身份验证 API 时遇到问题。 我有 JWT 登录的设置,并使用 Spring Security OncePerRequestFilter 注册路由。 出于某种原因,当我尝试登录时,它还会尝试运行doFilter方法。 意思是,即使用户尝试使用username an ...
[英]Why antMatchers not working and trying to authenticate Login route?
我在 spring 安全性中进行身份验证 API 时遇到问题。 我有 JWT 登录的设置,并使用 Spring Security OncePerRequestFilter 注册路由。 出于某种原因,当我尝试登录时,它还会尝试运行doFilter方法。 意思是,即使用户尝试使用username an ...
[英]Authentification manager + database
我正在尝试使用 spring 引导安全性在我的 spring 引导应用程序上设置身份验证系统,但我无法让它与我的数据库一起使用。 如果我尝试使用在我的 InMemoryUserDetailsManager 中创建的用户凭据登录,我的 AuthenticationManager 将完全正常工作(如果凭 ...
[英]Move spring-security.xml configuration to java based spring boot configuration
我有一个在 spring 中实现的现有项目,现在我将这个项目移动到 spring 启动。 现有项目包含 spring-security.xml 有人知道如何将以上配置移动到 spring 引导配置吗 ...
[英]ALL requests returning as Forbiddden 403 after implementing WebSecurityConfigurerAdapter
我刚刚将 WebSecurityConfigurerAdapter 添加到我的项目中,以尝试创建用户逻辑(登录名 - 密码 - 用户可以对我的应用程序执行的操作),这是有史以来第一次,但确实出了点问题。 每当我尝试向任何路径或任何类型的方法发出请求时,它都会返回 403 Forbidden。 我不知 ...
[英]Is the searchFilter specified with my ADLdapAuthenticationProvider correct for my Active Directory structure?
在我的活动目录 DC 中,我在域“ myCompany.co.hk ”的 OU“特殊用户”中有一个名为“ Demo User ”的用户。 我正在使用 Spring Security 的ActiveDirectoryLdapAuthenticationProvider通过端口 636 上的 SSL ...
[英]How do I redirect to a specific uri after Google oauth using Spring Boot
我正在使用 Spring Boot 实现服务器。 在用户进行 oauth 登录后,我希望用户将 go 重定向到特定的 uri,以便让用户注册或登录。 Google OAuth 登录似乎工作正常,但它一直转到"/" uri。 我想将用户重定向到"/api/v1/member/oauth" 这是我的 ...
[英]Spring Authorization Server: Sending Opaque Token to Introspect endpoint returns "invalid_request"
我正在将项目迁移到 Spring 授权服务器 (1.0.0),但遇到了问题。 尽管缺少很多示例或文档,但我一直在努力尝试将其设置为使用授权代码流(使用 PKCE)返回不透明令牌。 我已经设法部署了 Scheme 并连接了所有服务,并且已经到了我的 SPA 可以发送用户登录授权服务器并使用返回的代码 ...
[英]Spring Security SecurityFilterChain not working
我有一个 Spring Boot 3 项目,它有 web 页和一个 API。REST API 应该打开(并使用 API 密钥)并且 88424589855024 的应用程序将被验证我有一个单独的过滤器来处理密钥检查。 例如,如果我不提供 API 密钥,而我使用此安全配置,它不会返回正确的 JSON ...
[英]Logout doesn't work after updating Spring Boot from 2.7 to 3.0.1
我有一个 Spring 启动应用程序和 web 安全配置如下所示:@Configuration @EnableWebSecurity(debug = false) public class WebSecurityConfig extends WebSecurityConfigurerAdapter ...
[英]Add additional inner user validation after successful OAuth2 Resource Server JWT check at Keycloak
有一个 Spring 启动应用程序,其端点受 JWT 保护。令牌验证由 Spring 启动 OAuth2 资源服务器执行,该服务器在 Keycloak 授权服务器上检查令牌。 App在Keycloak授权成功后,如何添加额外的内部用户验证? 所以我想构建某种链 - 如果令牌在 Auth Serve ...
[英]SecurityFilterChain bean loaded in initilization but ignored on HTTP Requests
我为我的 Spring-boot 应用程序实现了自定义过滤器,但仍然无法通过 SecurityFilterChain bean 获得对 go 的请求。 这是我的 bean 中的代码。 它在我启动应用程序时被加载,但在我发出请求时被忽略,知道可能是什么问题吗? 我尝试了一些配置,禁用了 spring ...
[英]Replacing deprecated WebSecurityConfigurerAdapter for web security
我有一个 class,它扩展了现在已弃用的 WebSecurityConfigurerAdapter: class 如下所示: 从https://www.bezkoder.com/websecurityconfigureradapter-deprecated-spring-boot/ ,我注意到 ...
[英]Spring Security CORS Blocked By Policy
这应该很容易,但当然因为它是 Spring Security,所以不是。 我正在尝试从 Angular 应用程序访问作为 Spring 引导应用程序运行的相对简单的 api。 Angular 可以正常调用 API,但由于 CORS 策略,后端会阻止请求: 我将以下内容添加到我的安全配置中: ...
[英]AWS Cognito use custom attribute to map Spring application ROLE instead of cognito:groups
在我的应用程序中,用户分为 2 个宏类别:客户和后台,每个类别都有一个角色子集,例如客户类型的 MANAGER 和 USER 以及后台类型的不同角色。 因此,用户可以是具有 MANAGER 角色的 Customer 或具有 SALES 角色的 Backoffice。 每个 Spring + web ...
[英]Spring OAuth2.0 : Spring Authorization Server 1.0 and Resource server in the same boot application
我正在努力使用完全相同的 Spring Boot 3.0 应用程序作为身份验证服务器和资源服务器,但直到现在,我还无法使整个工作正常进行。 首先,我定义了一个非常简单的 RestController: 然后,基本上按照在 Spring 的示例项目中找到的代码,我设法将我的启动应用程序设置为 Spri ...
[英]PermitAll with addFilterAfter not working
努力使用新的 Spring Security 6.x。 具有以下SecuritsFilterChain :@Configuration @EnableWebSecurity @EnableMethodSecurity public class SecurityConfiguration { ...
[英]No thread-bound request found when setting attribute to HttpSession
我将使用 oauth2 登录。 我使用的是Spring Boot 3.0 with Spring Security 6. 登录并保存用户信息到数据库成功,但是之后保存用户信息到HttpSession时出错。 我想知道为什么会发生此错误,我正在寻找一种方法来修复它。 下面是我的代码。 安全配置pack ...
[英]Authorize using acess token
我已经使用带有 amazon cognito 的 oauth2 标准流程来保护我的应用程序。 它工作正常。 有时我想通过我的移动应用程序链接到我的网络应用程序,我不想让用户再次登录。 我如何创建一个@AnonymousAllowed 端点,它接收访问令牌、使用 spring 安全性进行身份验证并重定 ...
[英]Keycloak Spring Implementation combining Roles
我有一个问题,经过大量研究后我无法解决。 我有一个带有客户端(应用程序)和保护应用程序的角色的 Keyloak。 在我的应用程序中,如果用户或其他应用程序的角色与定义的角色匹配,我会检查 with.hasRole()-Method。 除了一切正常。 问题是我想合并角色并在应用程序中检查它们。 要访问 ...
[英]Access based on REALM ROLES not working, Spring Security 6 & Keycloak
我想根据 realm 角色授予访问权限。 我正在使用 Keycloak 和 Spring Boot 3 (Spring Security 6)。 我用所需的角色名称尝试了 hasRole()/hasAnyRole/hasAuthority/hasAnyAuthority。 字母大小写相同。 默认情 ...