【问题标题】:SonarQube Azure AD SAML authenticationSonarQube Azure AD SAML 身份验证
【发布时间】:2021-11-26 11:47:38
【问题描述】:

我在 docker-compose 上有一个带有 Nginx 的 SQ 实例,当通过 Azure 的 AD 添加 SAML AUTH 时出现以下错误;

来自 SQ 容器 -

ERROR web[AXxUzLA1NnhuSmG1AAB5][c.o.s.a.SamlResponse] 在 http://sonarqube:9000/oauth2/callback/saml 而不是 https://sonarqube-hello.msappproxy.net/oauth2/callback/saml 收到响应 错误 web[AXxUzLA1NnhuSmG1AAB5][c.o.saml2.Auth] processResponse 错误。无效响应

来自 SQ UI -

Azure 中的日志表明授权成功

Nginx 配置 -

  listen 80;

  client_max_body_size 100M;

  server_name sonarqube.local;

  location / {
    proxy_pass http://sonarqube:9000;
  }
}


server {
 listen 443 ssl;
 ssl_certificate /etc/nginx/conf.d/ssl/server.pem;
 ssl_certificate_key /etc/nginx/conf.d/ssl/server.key;
 location / {
   proxy_pass http://sonarqube:9000;
   proxy_set_header Host $host;
   proxy_set_header X-Forwarded-For $remote_addr;
   proxy_set_header X-Forwarded-Proto https;
 }
}
  • Sonar 9.1 版,无插件
  • SAML 提供程序与其他工具配合得很好

【问题讨论】:

    标签: azure nginx azure-active-directory sonarqube saml


    【解决方案1】:

    根据错误,似乎问题出在 URL 上。请重新检查重定向 URI。它应该在下拉列表中设置为“Web”,对于 URL 字段,您应该提及插件的身份验证 URL。此 URL 是您的主要 SonarQube URL,末尾带有“/oauth2/callback/aad”。例如,如果您的主 URL 是“https://sonarqube.example.com/”,则应输入“https://sonarqube.example.com/oauth2/callback/aad”。

    同时在Administration >>Configuration >> General >> Server base URL中设置要配置HTTPS地址的Server base URL: 重定向 URL 必须有 https,非 https 地址会抛出错误。

    Reference

    SonarQube Integration with Azure Active Directory

    【讨论】:

      猜你喜欢
      • 2016-12-19
      • 2018-09-13
      • 1970-01-01
      • 2019-06-25
      • 1970-01-01
      • 1970-01-01
      • 2019-11-19
      • 1970-01-01
      • 2019-10-15
      相关资源
      最近更新 更多