mirror of
https://github.com/dataease/dataease.git
synced 2026-06-17 21:08:31 +08:00
feat(X-Pack): 认证设置新增 SAML2
This commit is contained in:
committed by
fit2cloud-chenyw
parent
41ab73356c
commit
e460e6eedb
@@ -11,4 +11,4 @@
|
||||
|
||||
<artifactId>api-base</artifactId>
|
||||
|
||||
</project>
|
||||
</project>
|
||||
|
||||
@@ -41,6 +41,14 @@ public interface XpackAuthenticationApi {
|
||||
@PostMapping("/save/oauth2")
|
||||
String saveOauth2(@RequestBody XpackOauth2VO editor);
|
||||
|
||||
@Operation(summary = "保存SAML2")
|
||||
@PostMapping("/save/saml")
|
||||
String saveSaml2(@RequestBody XpackSaml2VO editor);
|
||||
|
||||
@Operation(summary = "SAML2信息")
|
||||
@GetMapping("/info/saml")
|
||||
XpackSaml2VO samlInfo();
|
||||
|
||||
@Operation(summary = "OIDC信息")
|
||||
@GetMapping("/info/oidc")
|
||||
XpackOidcVO oidcInfo();
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package io.dataease.api.xpack.settings;
|
||||
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
||||
@Tag(name = "Saml2认证")
|
||||
@ApiSupport(order = 899)
|
||||
public interface XpackSaml2Api {
|
||||
|
||||
@GetMapping("/login")
|
||||
void saml2Login();
|
||||
|
||||
@PostMapping("/sso")
|
||||
void saml2Callback() throws Exception;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package io.dataease.api.xpack.settings.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.security.PrivateKey;
|
||||
import java.security.cert.X509Certificate;
|
||||
|
||||
@Data
|
||||
public class XpackSaml2VO implements Serializable {
|
||||
|
||||
private String spEntityId;
|
||||
private String spAcs;
|
||||
|
||||
private String idpSsoUrl;
|
||||
private String idpEntityId;
|
||||
private String idpLogoutUrl;
|
||||
|
||||
|
||||
@JsonIgnore
|
||||
private PrivateKey spPrivateKey;
|
||||
@JsonIgnore
|
||||
private X509Certificate spCertificate;
|
||||
@JsonIgnore
|
||||
private X509Certificate idpCertificate;
|
||||
|
||||
private int assertionValidityTime = 300; // 5分钟
|
||||
private boolean wantAssertionsSigned = true;
|
||||
private boolean wantAuthnRequestsSigned = true;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user