Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oauth模块 oidc 在application.yml 中 sa-token.oauth2-server.oidc 项的值不会生效 #681

Open
mocha666 opened this issue Sep 16, 2024 · 1 comment

Comments

@mocha666
Copy link

使用版本:

sa-token 1.39.0

在application.yml 中 sa-token.oauth2-server.oidc 项的值不会生效

配置中的
image

实际解析 id_token 得到的载荷
image

预期结果:

容器化的 一个账户自有中心中运行,环境下 前方还有waf 与代理 ,

发现自动获取的iss网址 是协议头与 这里获取的iss不一致,这里直接获取的 iss 与像是在服务中所获取的一个iss , 与实际客户端上获取的 iss 不一致 导致异常,我尝试在 配置文件 sa-token.oauth2-server.oidc 项中添加 iss 以固定 iss, 但实际是没有生效

@mocha666 mocha666 changed the title 在application.yml 中 sa-token.oauth2-server.oidc 项的值不会生效 oauth模块 oidc 在application.yml 中 sa-token.oauth2-server.oidc 项的值不会生效 Sep 16, 2024
@click33
Copy link
Collaborator

click33 commented Sep 16, 2024

应该是源码bug了,你暂时可以通过重写 OIDC 的 Scope 处理器,然后重写 getIss 方法,下个版本我们将修复此问题

@Component
public class CustomOidcScopeHandler extends OidcScopeHandler {

    @Override
    public String getIss() {
        // 返回配置的 iss 值
        return SaOAuth2Manager.getServerConfig().getOidc().getIss();
    }

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants