如何在WSO2中正确退出OIDC
我正在尝试从使用OIDC进行身份验证的应用程序注销。登录后,当我前往/注销时,我无法注销。我没有看到从WSO2控制台应用程序注销时用来查看的同意页面(我没有禁用它,因此它应该显示为确认注销)。之后,我被重定向到/login页面,在该页面中不需要插入凭据,我所要做的就是单击同意上的允许 配置安全类如何在WSO2中正确退出OIDC,wso2,wso2is,Wso2,Wso2is,我正在尝试从使用OIDC进行身份验证的应用程序注销。登录后,当我前往/注销时,我无法注销。我没有看到从WSO2控制台应用程序注销时用来查看的同意页面(我没有禁用它,因此它应该显示为确认注销)。之后,我被重定向到/login页面,在该页面中不需要插入凭据,我所要做的就是单击同意上的允许 配置安全类 public class ConfigSecurity extends WebSecurityConfigurerAdapter { protected void configure(Http
public class ConfigSecurity extends WebSecurityConfigurerAdapter {
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests()
.antMatchers("/login","/assets/**")
.permitAll()
.anyRequest()
.authenticated()
.and()
.oauth2Login().loginPage("/login")
.and()
.logout().logoutUrl("/logout")
.logoutSuccessHandler(oidcLogoutSuccessHandler());
}
@Autowired
private ClientRegistrationRepository clientRegistrationRepository;
private LogoutSuccessHandler oidcLogoutSuccessHandler() {
OidcClientInitiatedLogoutSuccessHandler oidcLogoutSuccessHandler =
new OidcClientInitiatedLogoutSuccessHandler(
this.clientRegistrationRepository);
oidcLogoutSuccessHandler.setPostLogoutRedirectUri(URI.create("http://localhost:8844/logout"));
return oidcLogoutSuccessHandler;
}
}
回调URI:
regexp=(http://localhost:8844/login/oauth2/code/wso2|http://localhost:8844/logout)
反向通道注销URI:https://localhost:9443/oidc/logout
Application.properties:
server.port=8844
#########
spring.security.oauth2.client.registration.wso2.client-name=WSO2 Identity Server
spring.security.oauth2.client.registration.wso2.client-id=5YvGdwKZaS6pTS_uZhfu_X8sNVYa
spring.security.oauth2.client.registration.wso2.client-secret=hGPrgFnlbuS5N7_srxRenz998h8a
spring.security.oauth2.client.registration.wso2.redirect-uri={baseUrl}/login/oauth2/code/wso2
spring.security.oauth2.client.registration.wso2.authorization-grant-type=authorization_code
spring.security.oauth2.client.registration.wso2.scope=openid
# spring.security.oauth2.client.provider.wso2.issuer-uri=https://localhost:9443/oauth2/oidcdiscovery
#Identity Server Properties
spring.security.oauth2.client.provider.wso2.authorization-uri=https://localhost:9443/oauth2/authorize
spring.security.oauth2.client.provider.wso2.token-uri=https://localhost:9443/oauth2/token
spring.security.oauth2.client.provider.wso2.user-info-uri=https://localhost:9443/oauth2/userinfo
spring.security.oauth2.client.provider.wso2.jwk-set-uri=https://localhost:9443/oauth2/jwks
有人能帮忙吗
提前感谢Springboot oauth客户端从发现端点派生IDP的OIDC注销端点。问题是,从应用程序属性文件中,应用程序找不到IDP的注销端点。令牌端点、授权url、用户信息uri和jwk集uri可以单独配置。但没有办法以这种方式配置注销url。由于WSO2支持OIDC发现,所有端点令牌端点、授权url、用户信息uri和jwk集合uri url、注销端点都可以从issuer_uri属性中获得。因此,删除令牌端点、授权url、用户信息uri和jwk集合uri配置,并添加问题uri配置。将以下配置应用于属性文件,请参阅
server.port=8844
#########
spring.security.oauth2.client.registration.wso2.client-name=WSO2 Identity Server
spring.security.oauth2.client.registration.wso2.client-id=5YvGdwKZaS6pTS_uZhfu_X8sNVYa
spring.security.oauth2.client.registration.wso2.client-secret=hGPrgFnlbuS5N7_srxRenz998h8a
spring.security.oauth2.client.registration.wso2.redirect-uri={baseUrl}/login/oauth2/code/wso2
spring.security.oauth2.client.registration.wso2.authorization-grant-type=authorization_code
spring.security.oauth2.client.registration.wso2.scope=openid
spring.security.oauth2.client.provider.wso2.issuer-uri=https://localhost:9443/oauth2/token
您可以参考以下文档:
能否提供spring boot应用程序的属性文件?在IS端,您已配置为回调URI,但在应用程序端,您已配置为注销后重定向URI。看到端口号的差异了吗?这是内涵吗?你能改变它,看看它的行为吗?@Maduragasiriwardena我也注意到了,这是一个错误,不是故意的,我改变了它,但没有任何改变,我仍然得到相同的结果thing@PiraveenaParalogarajah我已将application.properties文件包含在问题中如果您检查浏览器控制台,您是否在中提到的注销请求中看到id\u token\u提示