如何在所有模板中显示当前登录用户的信息,包括在Spring安全应用程序中由WebMvcConfigurerAdapter管理的视图

问题描述我有一个SpringBoot应用程序,它使用了SpringSecurity和Thymeleaf模板。当控制器由WebConfigurerAdapter的子类管理时,我尝试在模板中显示登录用户的名字和姓氏。假设我的WebConfigurerAdapter子类如下所示@Con

发布:2022-10-16 标签:javaspringspring-mvcspring-securitythymeleaf


LoggerFactory不是Logback LoggerContext,但Logback位于类路径上

问题描述我认为Spring-Boot-starter-Security中的某些模块与log4j冲突,但我不知道是哪个模块。我的Gradle依赖如下:compile("org.springframework.boot:spring-boot-starter-thymeleaf")c

发布:2022-10-16 标签:javaloggingspring-bootspring-securitydependency-management


Spring安全SAML:自己的登录页面,而不是ADFS登录重定向

问题描述在用SAML使用SAML进行ADFS登录的Spring安全性方面花了很多时间之后,我成了框架的粉丝。我能够将我的Web应用程序与ADFS集成以进行登录。但我在这里遗漏了几个要求:1)当我们在我的Web应用程序登录页面上选择IdPADFS登录URL时,它将从我的Web应用程

发布:2022-10-16 标签:saml-2.0spring-securityspring-saml


EnableAuthorizationServer正在工作,未被弃用

问题描述我关注的是guide,它提到@EnableAuthorizationServer已弃用。但是,当我创建了一个具有以下依赖项的项目时,我没有收到不推荐使用的消息。我是不是漏掉了什么?依赖-mvndependency:tree的输出[INFO]---maven-depende

发布:2022-10-16 标签:spring-securityspring-security-oauth2


如何在JWT中使用SpringAUTORIZATION-SERVER创建定制声明

问题描述我正在基于实验性的Spring项目SpringAuthorizationServer构建一个OAuth2授权服务器我的用例非常简单,从一个数据库中获取用户,并根据用户的一些属性,在生成的JWT中设置一些定制声明。我还没有找到使用SpringAuthorizationSer

发布:2022-10-16 标签:springspring-bootspring-securityspring-security-oauth2


如何通过.properties文件配置@RequestParam?

问题描述如何通过.properties文件使以下内容可配置?@RequestParam(value="page",required=false,defaultValue="0")Integerpage,@RequestParam(value="size",required=fal

发布:2022-10-16 标签:spring-mvcspring-securityspring-data-mongodb


单元测试中如何通过对Thymeleasf模板的认证

问题描述我使用的是SpringBoot2.0.8.RELEASE。我有一个控制器,它有以下方法构造@PostMapping(value="/profile/change-password",consumes=MediaType.APPLICATION_FORM_URLENCODE

发布:2022-10-16 标签:spring-bootspring-webfluxspring-securityspring-test


Spring Security OAuth2/OIDC RP启动的注销不起作用

问题描述我正在尝试使用SpringSecurity来实现RP发起的注销,从SpringCloudGateway到Keyshaak。我的SpringSecurity配置与SpringSecurityReferencedocument中提供的配置几乎相同,转载如下:@EnableWe

发布:2022-10-16 标签:keycloakspring-bootspring-securityspring-cloud-gateway


使用G Suite作为IdP的Spring Security SAML2

问题描述我正在尝试使用SpringSecurity(5.3.3.RELEASE)来处理SpringBoot应用程序中的SAML2身份验证。带有BESP和GSuite的SpringBoot应用程序将成为IdP。在我的Mavenpom.xml文件中有:<dependency><gro

发布:2022-10-16 标签:javasaml-2.0spring-securitygoogle-workspacespring-security-saml2


Spring-Security saml2:如何获取当前用户?

问题描述我正在使用5.2.0.RELEASE版本的Spring-Security和Spring-Security-saml2-service-Provider。我尝试在IdP进行身份验证后获取当前断言,以便将其映射到本地系统中的用户。我使用此代码来获取Saml2Authentic

发布:2022-10-16 标签:saml-2.0spring-securityspring-samlspring-security-saml2