- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.apache.wss4j.common.principal.WSUsernameTokenPrincipalImpl.setNonce()
方法的一些代码示例,展示了WSUsernameTokenPrincipalImpl.setNonce()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WSUsernameTokenPrincipalImpl.setNonce()
方法的具体详情如下:
包路径:org.apache.wss4j.common.principal.WSUsernameTokenPrincipalImpl
类名称:WSUsernameTokenPrincipalImpl
方法名:setNonce
[英]Set the WSUsernameToken nonce for this WSUsernameTokenPrincipalImpl
.
[中]为此[$0$]设置WSUsernameToken nonce。
代码示例来源:origin: apache/cxf
/**
* Create a principal based on the authenticated UsernameToken.
* @throws Base64DecodingException
*/
private Principal createPrincipal(
String username,
String passwordValue,
String passwordType,
String nonce,
String createdTime
) {
boolean hashed = false;
if (WSS4JConstants.PASSWORD_DIGEST.equals(passwordType)) {
hashed = true;
}
WSUsernameTokenPrincipalImpl principal = new WSUsernameTokenPrincipalImpl(username, hashed);
if (nonce != null) {
principal.setNonce(Base64.getMimeDecoder().decode(nonce));
}
principal.setPassword(passwordValue);
principal.setCreatedTime(createdTime);
principal.setPasswordType(passwordType);
return principal;
}
代码示例来源:origin: org.apache.cxf.services.sts/cxf-services-sts-core
/**
* Create a principal based on the authenticated UsernameToken.
* @throws Base64DecodingException
*/
private Principal createPrincipal(
String username,
String passwordValue,
String passwordType,
String nonce,
String createdTime
) {
boolean hashed = false;
if (WSS4JConstants.PASSWORD_DIGEST.equals(passwordType)) {
hashed = true;
}
WSUsernameTokenPrincipalImpl principal = new WSUsernameTokenPrincipalImpl(username, hashed);
if (nonce != null) {
principal.setNonce(Base64.getMimeDecoder().decode(nonce));
}
principal.setPassword(passwordValue);
principal.setCreatedTime(createdTime);
principal.setPasswordType(passwordType);
return principal;
}
代码示例来源:origin: org.apache.wss4j/wss4j-ws-security-dom
/**
* Create a WSUsernameTokenPrincipal from this UsernameToken object
*/
public Principal createPrincipal() throws WSSecurityException {
WSUsernameTokenPrincipalImpl principal =
new WSUsernameTokenPrincipalImpl(getName(), isHashed());
String nonce = getNonce();
if (nonce != null) {
principal.setNonce(org.apache.xml.security.utils.XMLUtils.decode(nonce));
}
principal.setPassword(getPassword());
principal.setCreatedTime(getCreated());
return principal;
}
代码示例来源:origin: apache/cxf
public Credential validate(Credential credential, RequestData data) throws WSSecurityException {
Credential cred = super.validate(credential, data);
UsernameToken ut = credential.getUsernametoken();
WSUsernameTokenPrincipalImpl principal =
new WSUsernameTokenPrincipalImpl(ut.getName(), ut.isHashed());
principal.setCreatedTime(ut.getCreated());
principal.setNonce(principal.getNonce());
principal.setPassword(ut.getPassword());
principal.setPasswordType(ut.getPasswordType());
Subject subject = new Subject();
subject.getPrincipals().add(principal);
if ("Alice".equals(ut.getName())) {
subject.getPrincipals().add(new SimpleGroup("manager", ut.getName()));
}
subject.getPrincipals().add(new SimpleGroup("worker", ut.getName()));
cred.setSubject(subject);
return cred;
}
}
代码示例来源:origin: apache/cxf
protected UsernameTokenPrincipal parseTokenAndCreatePrincipal(Element tokenElement, boolean bspCompliant)
throws WSSecurityException, Base64DecodingException {
BSPEnforcer bspEnforcer = new org.apache.wss4j.common.bsp.BSPEnforcer(!bspCompliant);
org.apache.wss4j.dom.message.token.UsernameToken ut =
new org.apache.wss4j.dom.message.token.UsernameToken(tokenElement, false, bspEnforcer);
WSUsernameTokenPrincipalImpl principal = new WSUsernameTokenPrincipalImpl(ut.getName(), ut.isHashed());
if (ut.getNonce() != null) {
principal.setNonce(XMLUtils.decode(ut.getNonce()));
}
principal.setPassword(ut.getPassword());
principal.setCreatedTime(ut.getCreated());
principal.setPasswordType(ut.getPasswordType());
return principal;
}
代码示例来源:origin: org.apache.cxf/cxf-rt-ws-security
protected UsernameTokenPrincipal parseTokenAndCreatePrincipal(Element tokenElement, boolean bspCompliant)
throws WSSecurityException, Base64DecodingException {
BSPEnforcer bspEnforcer = new org.apache.wss4j.common.bsp.BSPEnforcer(!bspCompliant);
org.apache.wss4j.dom.message.token.UsernameToken ut =
new org.apache.wss4j.dom.message.token.UsernameToken(tokenElement, false, bspEnforcer);
WSUsernameTokenPrincipalImpl principal = new WSUsernameTokenPrincipalImpl(ut.getName(), ut.isHashed());
if (ut.getNonce() != null) {
principal.setNonce(XMLUtils.decode(ut.getNonce()));
}
principal.setPassword(ut.getPassword());
principal.setCreatedTime(ut.getCreated());
principal.setPasswordType(ut.getPasswordType());
return principal;
}
代码示例来源:origin: org.apache.wss4j/wss4j-ws-security-dom
new WSUsernameTokenPrincipalImpl(token.getName(), token.isHashed());
if (token.getNonce() != null) {
principal.setNonce(XMLUtils.decode(token.getNonce()));
本文整理了Java中org.apache.wss4j.common.principal.WSUsernameTokenPrincipalImpl.setPasswordType()方法的一些代码示例,
本文整理了Java中org.apache.wss4j.common.principal.WSUsernameTokenPrincipalImpl.setCreatedTime()方法的一些代码示例,展
本文整理了Java中org.apache.wss4j.common.principal.WSUsernameTokenPrincipalImpl.setPassword()方法的一些代码示例,展示了W
本文整理了Java中org.apache.wss4j.common.principal.WSUsernameTokenPrincipalImpl.()方法的一些代码示例,展示了WSUsernameTo
本文整理了Java中org.apache.wss4j.common.principal.WSUsernameTokenPrincipalImpl.setNonce()方法的一些代码示例,展示了WSUs
我是一名优秀的程序员,十分优秀!