本文整理了Java中org.apache.ws.security.WSUsernameTokenPrincipal.getName()
方法的一些代码示例,展示了WSUsernameTokenPrincipal.getName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WSUsernameTokenPrincipal.getName()
方法的具体详情如下:
包路径:org.apache.ws.security.WSUsernameTokenPrincipal
类名称:WSUsernameTokenPrincipal
方法名:getName
[英]Return the WSUsernameToken username for this WSUsernameTokenPrincipal
.
[中]返回此WSUsernameTokenPrincipal
的WSUsernameToken用户名。
代码示例来源:origin: stackoverflow.com
WSUsernameTokenPrincipal mockedWsutp = mock(WSUsernameTokenPrincipal.class);
when(mockedWsutp.getName()).thenReturn("TheNameRequiredForYourTestCase");
...
代码示例来源:origin: stackoverflow.com
@WebResult(name = "UpdatePatternResponse", targetNamespace = "http://test.com/schemas/xsd/myservice/", partName = "UpdatePatternResponse")
@WebMethod(operationName = "UpdatePattern", action = "UpdatePattern")
@Generated(value = "org.apache.cxf.tools.wsdlto.WSDLToJava", date = "2015-02-19T12:49:59.491-05:00")
public test.com.schemas.xsd.myservice.UpdatePatternResponse updatePattern(
@WebParam(partName = "UpdatePatternRequest", name = "UpdatePatternRequest", targetNamespace = "http://test.com/schemas/xsd/myservice/")
test.com.schemas.xsd.myservice.UpdatePatternRequest updatePatternRequest
) throws SIASFaultMessage{
.
.
Message message = PhaseInterceptorChain.getCurrentMessage();
WSUsernameTokenPrincipal principal = (WSUsernameTokenPrincipal)message.get("wss4j.principal.result");
String userName = principal.getName();
.
.
.
}
代码示例来源:origin: org.apache.rampart/rampart-core
/**
* Scan through {@link WSHandlerResult} list for a Username token and return
* the username if a Username Token found
* @param results
* @return
*/
public static String getUsername(List<WSHandlerResult> results) {
/*
* Scan the results for a matching actor. Use results only if the
* receiving Actor and the sending Actor match.
*/
for (WSHandlerResult result : results) {
List<WSSecurityEngineResult> wsSecEngineResults = result.getResults();
/*
* Scan the results for a username token. Use the username
* of this token to set the alias for the encryption user
*/
for (WSSecurityEngineResult wsSecEngineResult : wsSecEngineResults) {
Integer actInt = (Integer) wsSecEngineResult.get(WSSecurityEngineResult.TAG_ACTION);
if (actInt == WSConstants.UT) {
WSUsernameTokenPrincipal principal = (WSUsernameTokenPrincipal) wsSecEngineResult.
get(WSSecurityEngineResult.TAG_PRINCIPAL);
return principal.getName();
}
}
}
return null;
}
代码示例来源:origin: org.apache.servicemix/servicemix-cxf-bc
WSUsernameTokenPrincipal p = (WSUsernameTokenPrincipal)er.get(WSSecurityEngineResult.TAG_PRINCIPAL);
subject.getPrincipals().add(p);
this.authenticationService.authenticate(subject, domain, p.getName(), p.getPassword());
authenticated = true;
代码示例来源:origin: edu.internet2.middleware.grouper/grouper-ws
userIdLoggedIn = principal.getName();
break OUTER;
代码示例来源:origin: org.n52.security/52n-security-sts
AuthenticationService authenticationService = securityConfig.getServiceConfig(STSAuthenticationService.SERVICENAME).getAuthenticationService();
CredentialsCallbackHandler ccbh = new CredentialsCallbackHandler();
ccbh.add(new UsernamePasswordCredential(token.getName(), token
.getPassword()));
AuthenticationContext authCxt = authenticationService.login(ccbh);
代码示例来源:origin: org.apache.rampart/rampart-core
String username = userNameTokenPrincipal.getName();
msgCtx.setProperty(RampartMessageData.USERNAME, username);
内容来源于网络,如有侵权,请联系作者删除!