Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
yujianwangzivayy
MaxKey
提交
6d10df30
MaxKey
项目概览
yujianwangzivayy
/
MaxKey
与 Fork 源项目一致
Fork自
MaxKey单点登录官方(MaxKeyTop) / MaxKey
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
MaxKey
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6d10df30
编写于
2月 28, 2020
作者:
MaxKey单点登录官方
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
SAML UPDATE
支持腾讯云和阿里云SAML 单点登录,支持属性扩展
上级
025912d1
变更
20
展开全部
隐藏空白更改
内联
并排
Showing
20 changed file
with
144 addition
and
46 deletion
+144
-46
maxkey-core/src/main/java/org/maxkey/domain/ExtraAttr.java
maxkey-core/src/main/java/org/maxkey/domain/ExtraAttr.java
+15
-1
maxkey-protocols/maxkey-protocol-saml-2.0/.sts4-cache/classpath-data.json
.../maxkey-protocol-saml-2.0/.sts4-cache/classpath-data.json
+1
-1
maxkey-protocols/maxkey-protocol-saml-2.0/src/main/java/org/maxkey/authz/saml20/metadata/endpoint/MetadataEndpoint.java
...xkey/authz/saml20/metadata/endpoint/MetadataEndpoint.java
+3
-3
maxkey-protocols/maxkey-protocol-saml-2.0/src/main/java/org/maxkey/authz/saml20/provider/endpoint/AssertionEndpoint.java
...key/authz/saml20/provider/endpoint/AssertionEndpoint.java
+6
-2
maxkey-protocols/maxkey-protocol-saml-2.0/src/main/java/org/maxkey/authz/saml20/provider/xml/AssertionGenerator.java
.../maxkey/authz/saml20/provider/xml/AssertionGenerator.java
+0
-1
maxkey-protocols/maxkey-protocol-saml-2.0/src/main/java/org/maxkey/authz/saml20/provider/xml/AttributeStatementGenerator.java
...uthz/saml20/provider/xml/AttributeStatementGenerator.java
+30
-5
maxkey-protocols/maxkey-protocol-saml-2.0/src/main/java/org/maxkey/authz/saml20/provider/xml/AuthnResponseGenerator.java
...key/authz/saml20/provider/xml/AuthnResponseGenerator.java
+46
-4
maxkey-protocols/maxkey-protocol-saml-2.0/src/main/java/org/maxkey/authz/saml20/provider/xml/SubjectGenerator.java
...rg/maxkey/authz/saml20/provider/xml/SubjectGenerator.java
+11
-14
maxkey-web-manage/.sts4-cache/classpath-data.json
maxkey-web-manage/.sts4-cache/classpath-data.json
+1
-1
maxkey-web-manage/src/main/java/org/maxkey/web/apps/contorller/SAML20DetailsController.java
...g/maxkey/web/apps/contorller/SAML20DetailsController.java
+4
-0
maxkey-web-manage/src/main/resources/config/applicationConfig.properties
...ge/src/main/resources/config/applicationConfig.properties
+1
-0
maxkey-web-manage/src/main/resources/messages/message.properties
...web-manage/src/main/resources/messages/message.properties
+1
-0
maxkey-web-manage/src/main/resources/messages/message_en.properties
...-manage/src/main/resources/messages/message_en.properties
+1
-0
maxkey-web-manage/src/main/resources/spring/maxkey-mgt.xml
maxkey-web-manage/src/main/resources/spring/maxkey-mgt.xml
+4
-0
maxkey-web-manage/src/main/resources/templates/views/apps/formbased/appUpdate.ftl
...in/resources/templates/views/apps/formbased/appUpdate.ftl
+11
-8
maxkey-web-manage/src/main/resources/templates/views/apps/saml20/appAdd.ftl
...src/main/resources/templates/views/apps/saml20/appAdd.ftl
+1
-2
maxkey-web-manage/src/main/resources/templates/views/apps/saml20/appUpdate.ftl
.../main/resources/templates/views/apps/saml20/appUpdate.ftl
+6
-1
maxkey-web-manage/src/main/resources/templates/views/apps/saml20/metadata.ftl
...c/main/resources/templates/views/apps/saml20/metadata.ftl
+0
-1
maxkey-web-manage/src/main/resources/templates/views/userinfo/changePassword.ftl
...ain/resources/templates/views/userinfo/changePassword.ftl
+1
-1
maxkey-web-maxkey/.sts4-cache/classpath-data.json
maxkey-web-maxkey/.sts4-cache/classpath-data.json
+1
-1
未找到文件。
maxkey-core/src/main/java/org/maxkey/domain/ExtraAttr.java
浏览文件 @
6d10df30
...
...
@@ -10,15 +10,23 @@ package org.maxkey.domain;
public
class
ExtraAttr
{
String
attr
;
String
type
;
String
value
;
public
ExtraAttr
(
String
attr
,
String
value
)
{
super
();
this
.
attr
=
attr
;
this
.
value
=
value
;
}
/**
* @param attr
* @param value
*/
public
ExtraAttr
(
String
attr
,
String
value
)
{
public
ExtraAttr
(
String
attr
,
String
type
,
String
value
)
{
super
();
this
.
attr
=
attr
;
this
.
type
=
type
;
this
.
value
=
value
;
}
public
String
getAttr
()
{
...
...
@@ -34,6 +42,12 @@ public class ExtraAttr {
this
.
value
=
value
;
}
public
String
getType
()
{
return
type
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
@Override
public
String
toString
()
{
return
"ExtraAttr [attr="
+
attr
+
", value="
+
value
+
"]"
;
...
...
maxkey-protocols/maxkey-protocol-saml-2.0/.sts4-cache/classpath-data.json
浏览文件 @
6d10df30
此差异已折叠。
点击以展开。
maxkey-protocols/maxkey-protocol-saml-2.0/src/main/java/org/maxkey/authz/saml20/metadata/endpoint/MetadataEndpoint.java
浏览文件 @
6d10df30
...
...
@@ -86,11 +86,11 @@ public class MetadataEndpoint {
IDPSSODescriptor
descriptor
=
metadataGenerator
.
buildIDPSSODescriptor
();
descriptor
.
getSingleSignOnServices
().
add
(
metadataGenerator
.
getSingleSignOnService
(
WebContext
.
getHttpContextPath
()+
"/saml/v20/auth
orize
/"
+
appId
,
null
));
descriptor
.
getSingleSignOnServices
().
add
(
metadataGenerator
.
getSingleSignOnService
(
WebContext
.
getHttpContextPath
()+
"/saml/v20/auth
z
/"
+
appId
,
null
));
descriptor
.
getSingleSignOnServices
().
add
(
metadataGenerator
.
getSingleSignOnService
(
WebContext
.
getHttpContextPath
()+
"/saml/v20/auth
orize
/"
+
appId
,
SAMLConstants
.
SAML2_REDIRECT_BINDING_URI
));
descriptor
.
getSingleSignOnServices
().
add
(
metadataGenerator
.
getSingleSignOnService
(
WebContext
.
getHttpContextPath
()+
"/saml/v20/auth
z
/"
+
appId
,
SAMLConstants
.
SAML2_REDIRECT_BINDING_URI
));
descriptor
.
getSingleSignOnServices
().
add
(
metadataGenerator
.
getSingleSignOnService
(
WebContext
.
getHttpContextPath
()+
"/saml/v20/auth
orize
/"
+
appId
,
SAMLConstants
.
SAML2_POST_SIMPLE_SIGN_BINDING_URI
));
descriptor
.
getSingleSignOnServices
().
add
(
metadataGenerator
.
getSingleSignOnService
(
WebContext
.
getHttpContextPath
()+
"/saml/v20/auth
z
/"
+
appId
,
SAMLConstants
.
SAML2_POST_SIMPLE_SIGN_BINDING_URI
));
descriptor
.
getSingleLogoutServices
().
add
(
metadataGenerator
.
getSingleLogoutService
(
WebContext
.
getHttpContextPath
()+
"/logout"
,
null
));
...
...
maxkey-protocols/maxkey-protocol-saml-2.0/src/main/java/org/maxkey/authz/saml20/provider/endpoint/AssertionEndpoint.java
浏览文件 @
6d10df30
...
...
@@ -7,6 +7,7 @@ import javax.servlet.http.HttpServletRequest;
import
javax.servlet.http.HttpServletResponse
;
import
org.joda.time.DateTime
;
import
org.maxkey.authn.BasicAuthentication
;
import
org.maxkey.authz.saml.common.AuthnRequestInfo
;
import
org.maxkey.authz.saml.common.EndpointGenerator
;
import
org.maxkey.authz.saml20.binding.BindingAdapter
;
...
...
@@ -48,7 +49,7 @@ public class AssertionEndpoint {
bindingAdapter
=
(
BindingAdapter
)
request
.
getSession
().
getAttribute
(
"samlv20Adapter"
);
logger
.
debug
(
"saml20 assertion get session samlv20Adapter "
+
bindingAdapter
);
AppsSAML20Details
saml20Details
=
bindingAdapter
.
getSaml20Details
();
logger
.
debug
(
"saml20Details "
+
saml20Details
.
getExtendAttr
());
AuthnRequestInfo
authnRequestInfo
=
bindingAdapter
.
getAuthnRequestInfo
();
if
(
authnRequestInfo
==
null
)
{
...
...
@@ -67,7 +68,10 @@ public class AssertionEndpoint {
grantedAuthority
.
add
(
anthGrantedAuthority
);
}
//TODO:
String
userName
=
authToken
.
getPrincipal
().
toString
();
//String userName ="shimingxy@qq.com";
String
userName
=((
BasicAuthentication
)
authToken
.
getPrincipal
()).
getJ_username
();
//aly
//String userName ="admin@1729982683323703.onaliyun.com";
DateTime
authnInstant
=
new
DateTime
(
request
.
getSession
().
getCreationTime
());
String
remoteAddress
=
WebContext
.
getRequestIpAddress
(
request
);
...
...
maxkey-protocols/maxkey-protocol-saml-2.0/src/main/java/org/maxkey/authz/saml20/provider/xml/AssertionGenerator.java
浏览文件 @
6d10df30
...
...
@@ -75,7 +75,6 @@ public class AssertionGenerator {
AttributeStatement
attributeStatement
=
attributeStatementGenerator
.
generateAttributeStatement
(
authorities
,
attributeMap
);
assertion
.
getAttributeStatements
().
add
(
attributeStatement
);
assertion
.
setID
(
idService
.
generateID
());
assertion
.
setIssueInstant
(
timeService
.
getCurrentDateTime
());
...
...
maxkey-protocols/maxkey-protocol-saml-2.0/src/main/java/org/maxkey/authz/saml20/provider/xml/AttributeStatementGenerator.java
浏览文件 @
6d10df30
...
...
@@ -5,6 +5,12 @@ import java.util.HashMap;
import
java.util.Iterator
;
import
java.util.Map
;
import
java.util.Map.Entry
;
import
org.maxkey.authz.saml20.binding.BindingAdapter
;
import
org.maxkey.domain.ExtraAttr
;
import
org.maxkey.domain.ExtraAttrs
;
import
org.maxkey.domain.apps.AppsSAML20Details
;
import
org.maxkey.web.WebContext
;
import
org.opensaml.Configuration
;
import
org.opensaml.saml2.core.Attribute
;
import
org.opensaml.saml2.core.AttributeStatement
;
...
...
@@ -14,10 +20,13 @@ import org.opensaml.saml2.core.impl.AttributeStatementBuilder;
import
org.opensaml.xml.XMLObjectBuilderFactory
;
import
org.opensaml.xml.schema.XSString
;
import
org.opensaml.xml.schema.impl.XSStringBuilder
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.security.core.GrantedAuthority
;
public
class
AttributeStatementGenerator
{
private
final
static
Logger
logger
=
LoggerFactory
.
getLogger
(
AttributeStatementGenerator
.
class
);
private
final
XMLObjectBuilderFactory
builderFactory
=
Configuration
.
getBuilderFactory
();
public
AttributeStatement
generateAttributeStatement
(
Collection
<
GrantedAuthority
>
authorities
)
{
...
...
@@ -44,22 +53,38 @@ public class AttributeStatementGenerator {
String
key
=
entry
.
getKey
();
String
value
=
entry
.
getValue
();
Attribute
attribute
=
builderAttribute
(
key
,
value
);
Attribute
attribute
=
builderAttribute
(
key
,
value
,
Attribute
.
BASIC
);
attributeStatement
.
getAttributes
().
add
(
attribute
);
}
}
BindingAdapter
bindingAdapter
=
(
BindingAdapter
)
WebContext
.
getSession
().
getAttribute
(
"samlv20Adapter"
);
AppsSAML20Details
saml20Details
=
bindingAdapter
.
getSaml20Details
();
logger
.
debug
(
"ExtendAttr "
+
saml20Details
.
getExtendAttr
());
ExtraAttrs
extraAttrs
=
new
ExtraAttrs
(
saml20Details
.
getExtendAttr
());
for
(
ExtraAttr
extraAttr
:
extraAttrs
.
getExtraAttrs
())
{
logger
.
debug
(
"Attribute : "
+
extraAttr
.
getAttr
()+
" , Vale : "
+
extraAttr
.
getValue
()+
" , Type : "
+
extraAttr
.
getType
());
attributeStatement
.
getAttributes
().
add
(
builderAttribute
(
extraAttr
.
getAttr
(),
extraAttr
.
getValue
(),
extraAttr
.
getType
()));
}
//tencent
//attributeStatement.getAttributes().add(builderAttribute("https://cloud.tencent.com/SAML/Attributes/Role","qcs::cam::uin/100013138092:roleName/cloud.tencent_maxkey,qcs::cam::uin/100013138092:saml-provider/maxkey",Attribute.UNSPECIFIED));
//attributeStatement.getAttributes().add(builderAttribute("https://cloud.tencent.com/SAML/Attributes/RoleSessionName","maxkey",Attribute.UNSPECIFIED));
//aliyun
//attributeStatement.getAttributes().add(builderAttribute("https://www.aliyun.com/SAML-Role/Attributes/RoleSessionName","2037230828547234327",Attribute.UNSPECIFIED));
//attributeStatement.getAttributes().add(builderAttribute("https://www.aliyun.com/SAML-Role/Attributes/Role","acs:ram::1729982683323703:role/maxkey,acs:ram::1729982683323703:saml-provider/maxkey",Attribute.UNSPECIFIED));
//attributeStatement.getAttributes().add(builderAttribute("https://www.aliyun.com/SAML-Role/Attributes/SessionDuration","1800",Attribute.UNSPECIFIED));
return
attributeStatement
;
}
public
Attribute
builderAttribute
(
String
attributeName
,
String
value
){
public
Attribute
builderAttribute
(
String
attributeName
,
String
value
,
String
nameFormat
){
AttributeBuilder
attributeBuilder
=
(
AttributeBuilder
)
builderFactory
.
getBuilder
(
Attribute
.
DEFAULT_ELEMENT_NAME
);
Attribute
attribute
=
attributeBuilder
.
buildObject
();
attribute
.
setName
(
attributeName
);
// urn:oasis:names:tc:SAML:2.0:attrname-format:basic
attribute
.
setNameFormat
(
Attribute
.
DEFAULT_ELEMENT_LOCAL_NAME
);
attribute
.
setNameFormat
(
nameFormat
);
// Response/Assertion/AttributeStatement/Attribute/AttributeValue
XSStringBuilder
stringBuilder
=
(
XSStringBuilder
)
builderFactory
.
getBuilder
(
XSString
.
TYPE_NAME
);
...
...
@@ -75,7 +100,7 @@ public class AttributeStatementGenerator {
// Response/Assertion/AttributeStatement/Attribute
AttributeBuilder
attributeBuilder
=
(
AttributeBuilder
)
builderFactory
.
getBuilder
(
Attribute
.
DEFAULT_ELEMENT_NAME
);
Attribute
attribute
=
attributeBuilder
.
buildObject
();
attribute
.
setName
(
GrantedAuthority
.
class
.
getName
()
);
attribute
.
setName
(
"GrantedAuthority"
);
// urn:oasis:names:tc:SAML:2.0:attrname-format:basic
attribute
.
setNameFormat
(
Attribute
.
BASIC
);
...
...
maxkey-protocols/maxkey-protocol-saml-2.0/src/main/java/org/maxkey/authz/saml20/provider/xml/AuthnResponseGenerator.java
浏览文件 @
6d10df30
...
...
@@ -26,8 +26,18 @@ import org.opensaml.xml.encryption.EncryptionConstants;
import
org.opensaml.xml.encryption.EncryptionException
;
import
org.opensaml.xml.encryption.EncryptionParameters
;
import
org.opensaml.xml.encryption.KeyEncryptionParameters
;
import
org.opensaml.xml.io.Marshaller
;
import
org.opensaml.xml.io.MarshallerFactory
;
import
org.opensaml.xml.io.MarshallingException
;
import
org.opensaml.xml.security.BasicSecurityConfiguration
;
import
org.opensaml.xml.security.credential.BasicCredential
;
import
org.opensaml.xml.security.credential.Credential
;
import
org.opensaml.xml.security.keyinfo.KeyInfoGeneratorFactory
;
import
org.opensaml.xml.signature.Signature
;
import
org.opensaml.xml.signature.SignatureConstants
;
import
org.opensaml.xml.signature.SignatureException
;
import
org.opensaml.xml.signature.Signer
;
import
org.opensaml.xml.signature.impl.SignatureBuilder
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.security.core.GrantedAuthority
;
...
...
@@ -87,6 +97,10 @@ public class AuthnResponseGenerator {
authnInstant
);
try
{
logger
.
debug
(
"authResponse.isSigned "
+
authResponse
.
isSigned
());
//assertion.setSignature(newSignature);
if
(
BOOLEAN
.
isTrue
(
saml20Details
.
getEncrypted
()))
{
// Assume this contains a recipient's RSA public
logger
.
info
(
"begin to encrypt assertion"
);
...
...
@@ -107,20 +121,48 @@ public class AuthnResponseGenerator {
encrypter
.
setKeyPlacement
(
KeyPlacement
.
PEER
);
EncryptedAssertion
encryptedAssertion
=
encrypter
.
encrypt
(
assertion
);
authResponse
.
getEncryptedAssertions
().
add
(
encryptedAssertion
);
}
else
{
authResponse
.
getAssertions
().
add
(
assertion
);
}
}
SignatureBuilder
signatureBuilder
=
(
SignatureBuilder
)
builderFactory
.
getBuilder
(
Signature
.
DEFAULT_ELEMENT_NAME
);
BasicCredential
basicCredential
=
new
BasicCredential
();
basicCredential
.
setPrivateKey
(
signingCredential
.
getPrivateKey
());
Signature
signature
=
signatureBuilder
.
buildObject
();
signature
.
setCanonicalizationAlgorithm
(
SignatureConstants
.
ALGO_ID_C14N_EXCL_OMIT_COMMENTS
);
signature
.
setSignatureAlgorithm
(
SignatureConstants
.
ALGO_ID_SIGNATURE_RSA_SHA256
);
signature
.
setSigningCredential
(
basicCredential
);
KeyInfoGeneratorFactory
keyInfoGeneratorFactory
=
Configuration
.
getGlobalSecurityConfiguration
()
.
getKeyInfoGeneratorManager
().
getDefaultManager
()
.
getFactory
(
signingCredential
);
signature
.
setKeyInfo
(
keyInfoGeneratorFactory
.
newInstance
().
generate
(
signingCredential
));
BasicSecurityConfiguration
config
=
(
BasicSecurityConfiguration
)
Configuration
.
getGlobalSecurityConfiguration
();
config
.
registerSignatureAlgorithmURI
(
"RSA"
,
SignatureConstants
.
ALGO_ID_SIGNATURE_RSA_SHA256
);
config
.
setSignatureReferenceDigestMethod
(
SignatureConstants
.
ALGO_ID_DIGEST_SHA256
);
assertion
.
setSignature
(
signature
);
Configuration
.
getMarshallerFactory
().
getMarshaller
(
assertion
).
marshall
(
assertion
);
Signer
.
signObject
(
signature
);
logger
.
debug
(
"assertion.isSigned "
+
assertion
.
isSigned
());;
authResponse
.
getAssertions
().
add
(
assertion
);
}
catch
(
EncryptionException
e
)
{
logger
.
info
(
"Unable to encrypt assertion ."
);
e
.
printStackTrace
();
}
catch
(
Exception
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
authResponse
.
setIssuer
(
responseIssuer
);
authResponse
.
setID
(
idService
.
generateID
());
authResponse
.
setIssueInstant
(
timeService
.
getCurrentDateTime
());
authResponse
.
setInResponseTo
(
inResponseTo
);
authResponse
.
getAssertions
().
add
(
assertion
);
//
authResponse.getAssertions().add(assertion);
authResponse
.
setDestination
(
assertionConsumerURL
);
authResponse
.
setStatus
(
statusGenerator
.
generateStatus
(
StatusCode
.
SUCCESS_URI
));
return
authResponse
;
...
...
maxkey-protocols/maxkey-protocol-saml-2.0/src/main/java/org/maxkey/authz/saml20/provider/xml/SubjectGenerator.java
浏览文件 @
6d10df30
...
...
@@ -3,7 +3,6 @@ package org.maxkey.authz.saml20.provider.xml;
import
org.maxkey.authz.saml.service.TimeService
;
import
org.opensaml.Configuration
;
import
org.opensaml.saml2.core.NameID
;
import
org.opensaml.saml2.core.NameIDType
;
import
org.opensaml.saml2.core.Subject
;
...
...
@@ -13,11 +12,10 @@ import org.opensaml.saml2.core.impl.NameIDBuilder;
import
org.opensaml.saml2.core.impl.SubjectBuilder
;
import
org.opensaml.saml2.core.impl.SubjectConfirmationBuilder
;
import
org.opensaml.saml2.core.impl.SubjectConfirmationDataBuilder
;
import
org.opensaml.xml.XMLObjectBuilderFactory
;
public
class
SubjectGenerator
{
private
final
XMLObjectBuilderFactory
builderFactory
=
Configuration
.
getBuilderFactory
();
//
private final XMLObjectBuilderFactory builderFactory = Configuration.getBuilderFactory();
private
final
TimeService
timeService
;
public
SubjectGenerator
(
TimeService
timeService
)
{
...
...
@@ -47,31 +45,30 @@ public class SubjectGenerator {
}
public
NameID
builderNameID
(
String
value
,
String
strSPNameQualifier
){
//Response/Assertion/Subject/NameID
NameIDBuilder
nameIDBuilder
=
(
NameIDBuilder
)
builderFactory
.
getBuilder
(
NameID
.
DEFAULT_ELEMENT_NAME
);
NameID
nameID
=
nameIDBuilder
.
buildObject
();
//Response/Assertion/Subject/NameID
NameID
nameID
=
new
NameIDBuilder
().
buildObject
();
nameID
.
setValue
(
value
);
nameID
.
setFormat
(
NameIDType
.
PERSISTENT
);
nameID
.
setSPNameQualifier
(
strSPNameQualifier
);
//nameID.setFormat(NameIDType.PERSISTENT);
nameID
.
setFormat
(
NameIDType
.
UNSPECIFIED
);
//nameID.setSPNameQualifier(strSPNameQualifier);
return
nameID
;
}
public
Subject
builderSubject
(
NameID
nameID
){
//Response/Assertion/Subject
SubjectBuilder
subjectBuilder
=
(
SubjectBuilder
)
builderFactory
.
getBuilder
(
Subject
.
DEFAULT_ELEMENT_NAME
);
Subject
subject
=
subjectBuilder
.
buildObject
();
Subject
subject
=
new
SubjectBuilder
().
buildObject
();
subject
.
setNameID
(
nameID
);
return
subject
;
}
public
SubjectConfirmation
builderSubjectConfirmation
(
String
recipient
,
String
inResponseTo
,
int
validInSeconds
,
String
clientAddress
){
SubjectConfirmationBuilder
subjectConfirmationBuilder
=
(
SubjectConfirmationBuilder
)
builderFactory
.
getBuilder
(
SubjectConfirmation
.
DEFAULT_ELEMENT_NAME
);
SubjectConfirmation
subjectConfirmation
=
subjectConfirmationBuilder
.
buildObject
();
//
SubjectConfirmationBuilder subjectConfirmationBuilder = (SubjectConfirmationBuilder)builderFactory.getBuilder(SubjectConfirmation.DEFAULT_ELEMENT_NAME);
SubjectConfirmation
subjectConfirmation
=
new
SubjectConfirmationBuilder
()
.
buildObject
();
subjectConfirmation
.
setMethod
(
SubjectConfirmation
.
METHOD_BEARER
);
SubjectConfirmationDataBuilder
subjectConfirmationDataBuilder
=
(
SubjectConfirmationDataBuilder
)
builderFactory
.
getBuilder
(
SubjectConfirmationData
.
DEFAULT_ELEMENT_NAME
);
SubjectConfirmationData
subjectConfirmationData
=
subjectConfirmationDataBuilder
.
buildObject
();
//
SubjectConfirmationDataBuilder subjectConfirmationDataBuilder = (SubjectConfirmationDataBuilder)builderFactory.getBuilder(SubjectConfirmationData.DEFAULT_ELEMENT_NAME);
SubjectConfirmationData
subjectConfirmationData
=
new
SubjectConfirmationDataBuilder
()
.
buildObject
();
subjectConfirmationData
.
setRecipient
(
recipient
);
//if idp-init not need inResponseTo
...
...
maxkey-web-manage/.sts4-cache/classpath-data.json
浏览文件 @
6d10df30
此差异已折叠。
点击以展开。
maxkey-web-manage/src/main/java/org/maxkey/web/apps/contorller/SAML20DetailsController.java
浏览文件 @
6d10df30
...
...
@@ -46,6 +46,9 @@ public class SAML20DetailsController extends BaseAppContorller {
@Autowired
AppsSaml20DetailsService
saml20DetailsService
;
@Autowired
String
maxKeyURI
;
@RequestMapping
(
value
=
{
"/forwardAdd"
})
public
ModelAndView
forwardAdd
()
{
ModelAndView
modelAndView
=
new
ModelAndView
(
"apps/saml20/appAdd"
);
...
...
@@ -84,6 +87,7 @@ public class SAML20DetailsController extends BaseAppContorller {
decoderSecret
(
saml20Details
);
WebContext
.
setAttribute
(
saml20Details
.
getId
(),
saml20Details
.
getIcon
());
modelAndView
.
addObject
(
"model"
,
saml20Details
);
modelAndView
.
addObject
(
"maxKeyURI"
,
maxKeyURI
);
return
modelAndView
;
}
/**
...
...
maxkey-web-manage/src/main/resources/config/applicationConfig.properties
浏览文件 @
6d10df30
...
...
@@ -8,6 +8,7 @@ config.server.name=http://${config.server.domain.sub}
config.server.prefix.uri
=
${config.server.name}:9521/maxkey-mgt
#default.uri
config.server.default.uri
=
${config.server.prefix.uri}/main
config.maxkey.uri
=
${config.server.name}/maxkey
############################################################################
# Application Configuration
############################################################################
...
...
maxkey-web-manage/src/main/resources/messages/message.properties
浏览文件 @
6d10df30
...
...
@@ -321,6 +321,7 @@ apps.saml.nameIdConvert=NameId Convert
apps.saml.target
=
\u
76EE
\u6807\u5730\u5740
apps.saml.metadata.telephoneNumber
=
\u7535\u
8BDD
\u
53F7
\u7801
apps.saml.fileType.metadata
=
SAML
\u5143\u6570\u
636E
apps.saml.fileType.certificate
=
\u
8BC1
\u
4E66
apps.saml.metadata.givenName
=
\u
540D
apps.saml.issuer
=
Issuer
apps.saml.nameIdConvert.upperCase
=
\u5927\u5199
...
...
maxkey-web-manage/src/main/resources/messages/message_en.properties
浏览文件 @
6d10df30
...
...
@@ -319,6 +319,7 @@ apps.saml.nameIdConvert=NameId Convert
apps.saml.target
=
target
apps.saml.metadata.telephoneNumber
=
telephoneNumber
apps.saml.fileType.metadata
=
SAML Metadata Type
apps.saml.fileType.certificate
=
Certificate
apps.saml.metadata.givenName
=
givenName
apps.saml.issuer
=
Issuer
apps.saml.nameIdConvert.upperCase
=
upperCase
...
...
maxkey-web-manage/src/main/resources/spring/maxkey-mgt.xml
浏览文件 @
6d10df30
...
...
@@ -53,6 +53,10 @@
<constructor-arg
value=
"${config.saml.v20.sp.issuing.entity.id}"
/>
</bean>
<bean
id=
"maxKeyURI"
class=
"java.lang.String"
>
<constructor-arg
value=
"${config.maxkey.uri}"
/>
</bean>
<bean
id=
"oauth20JdbcClientDetailsService"
class=
"org.maxkey.authz.oauth2.provider.client.JdbcClientDetailsService"
>
<constructor-arg
ref=
"dataSource"
/>
<property
name=
"passwordEncoder"
ref=
"passwordReciprocal"
></property>
...
...
maxkey-web-manage/src/main/resources/templates/views/apps/formbased/appUpdate.ftl
浏览文件 @
6d10df30
...
...
@@ -32,15 +32,18 @@ $(function(){
var
attrIndex
=
0
;
function
addExtendAttr
(
attribute
,
attributeValue
){
var
html
=
'
<tr id="extendTr_
'
+
attrIndex
+
'
"><th><@locale code="apps.formbased.parameter"/>:
'
;
html
+=
'
<input class="button delExtendTr" type="button" name="delExtendTr" attrTrId="extendTr_
'
+
attrIndex
+
'
" value="<@locale code="button.text.delete" />"/>
'
;
html
+=
'
</th><td>
'
;
html
+=
'
<input type="text" class="form-control" id="attribute_
'
+
attrIndex
+
'
" name="attribute" class="int" title="" value="
'
+
attribute
+
'
"/>
'
;
html
+=
'
</span></td><th><@locale code="apps.formbased.parameter.value"/>:</th> <td><span class="intspan">
'
;
html
+=
'
<input type="text" class="form-control" id="attributeValue_
'
+
attrIndex
+
'
" name="attributeValue" class="int" title="" value="
'
+
attributeValue
+
'
"/>
'
;
html
+=
'
</span>
'
;
var
html
=
'
<tr id="extendTr_
'
+
attrIndex
+
'
">
'
;
html
+=
'
<th><@locale code="apps.formbased.parameter"/>:
'
;
html
+=
'
<input class="button delExtendTr" type="button" name="delExtendTr" attrTrId="extendTr_
'
+
attrIndex
+
'
" value="<@locale code="button.text.delete" />"/>
'
;
html
+=
'
</th>
'
;
html
+=
'
<td>
'
;
html
+=
'
<input type="text" class="form-control" id="attribute_
'
+
attrIndex
+
'
" name="attribute" class="int" title="" value="
'
+
attribute
+
'
"/>
'
;
html
+=
'
</span></td>
'
;
html
+=
'
<th><@locale code="apps.formbased.parameter.value"/>:</th> <td><span class="intspan">
'
;
html
+=
'
<input type="text" class="form-control" id="attributeValue_
'
+
attrIndex
+
'
" name="attributeValue" class="int" title="" value="
'
+
attributeValue
+
'
"/>
'
;
html
+=
'
</span></td>
'
;
html
+=
'
</t
d></t
r>
'
;
html
+=
'
</tr>
'
;
$
(
'
#extendAttrBody
'
).
append
(
html
);
attrIndex
++
;
}
...
...
maxkey-web-manage/src/main/resources/templates/views/apps/saml20/appAdd.ftl
浏览文件 @
6d10df30
...
...
@@ -12,8 +12,7 @@
<script
type=
"text/javascript"
>
<!--
$
(
function
(){
$
(
"
#protocol_text
"
).
html
(
"
<%=PROTOCOLS.SAML20%>
"
);
$
(
"
#protocol
"
).
val
(
"
<%=PROTOCOLS.SAML20%>
"
);
});
//-->
</script>
...
...
maxkey-web-manage/src/main/resources/templates/views/apps/saml20/appUpdate.ftl
浏览文件 @
6d10df30
...
...
@@ -55,6 +55,8 @@ $(function(){
<td
colspan =
3
>
<input
type=
"text"
class=
"form-control"
id=
"entityId"
name=
"entityId"
title=
""
value=
"${model.entityId}"
/>
</td>
</tr>
<tr>
<th><
@
locale
code=
"apps.saml.spAcsUrl"
/>
:
</th>
...
...
@@ -70,9 +72,12 @@ $(function(){
</tr>
<tr>
<th><
@
locale
code=
"apps.saml.audience"
/>
:
</th>
<td
colspan =
3
>
<td
colspan =
2
>
<input
type=
"text"
class=
"form-control"
id=
"audience"
name=
"audience"
title=
""
value=
"${model.audience}"
/>
</td>
<td
>
<a
target=
"_blank"
href=
"${maxKeyURI}/metadata/saml20/${model.id}.xml"
>
SAML MetaData
</a>
</td>
</tr>
<tr>
<th
style=
"width:15%;"
><
@
locale
code=
"apps.saml.nameidFormat"
/>
:
</th>
...
...
maxkey-web-manage/src/main/resources/templates/views/apps/saml20/metadata.ftl
已删除
100644 → 0
浏览文件 @
025912d1
<%@page contentType="text/xml; charset=UTF-8" %>${metadata}
\ No newline at end of file
maxkey-web-manage/src/main/resources/templates/views/userinfo/changePassword.ftl
浏览文件 @
6d10df30
...
...
@@ -12,7 +12,7 @@
</head>
<body>
<form
id=
"actionForm"
method=
"post"
type=
"label"
autoclose=
"true"
action=
"<@base/>/user
s
/changePassword"
>
<form
id=
"actionForm"
method=
"post"
type=
"label"
autoclose=
"true"
action=
"<@base/>/user
info
/changePassword"
>
<table
class=
"table table-bordered"
>
<tbody>
...
...
maxkey-web-maxkey/.sts4-cache/classpath-data.json
浏览文件 @
6d10df30
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录