org.apache.ws.security.WSUsernameTokenPrincipal.getName()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(113)

本文整理了Java中org.apache.ws.security.WSUsernameTokenPrincipal.getName()方法的一些代码示例,展示了WSUsernameTokenPrincipal.getName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WSUsernameTokenPrincipal.getName()方法的具体详情如下:
包路径:org.apache.ws.security.WSUsernameTokenPrincipal
类名称:WSUsernameTokenPrincipal
方法名:getName

WSUsernameTokenPrincipal.getName介绍

[英]Return the WSUsernameToken username for this WSUsernameTokenPrincipal.
[中]返回此WSUsernameTokenPrincipal的WSUsernameToken用户名。

代码示例

代码示例来源:origin: stackoverflow.com

  1. WSUsernameTokenPrincipal mockedWsutp = mock(WSUsernameTokenPrincipal.class);
  2. when(mockedWsutp.getName()).thenReturn("TheNameRequiredForYourTestCase");
  3. ...

代码示例来源:origin: stackoverflow.com

  1. @WebResult(name = "UpdatePatternResponse", targetNamespace = "http://test.com/schemas/xsd/myservice/", partName = "UpdatePatternResponse")
  2. @WebMethod(operationName = "UpdatePattern", action = "UpdatePattern")
  3. @Generated(value = "org.apache.cxf.tools.wsdlto.WSDLToJava", date = "2015-02-19T12:49:59.491-05:00")
  4. public test.com.schemas.xsd.myservice.UpdatePatternResponse updatePattern(
  5. @WebParam(partName = "UpdatePatternRequest", name = "UpdatePatternRequest", targetNamespace = "http://test.com/schemas/xsd/myservice/")
  6. test.com.schemas.xsd.myservice.UpdatePatternRequest updatePatternRequest
  7. ) throws SIASFaultMessage{
  8. .
  9. .
  10. Message message = PhaseInterceptorChain.getCurrentMessage();
  11. WSUsernameTokenPrincipal principal = (WSUsernameTokenPrincipal)message.get("wss4j.principal.result");
  12. String userName = principal.getName();
  13. .
  14. .
  15. .
  16. }

代码示例来源:origin: org.apache.rampart/rampart-core

  1. /**
  2. * Scan through {@link WSHandlerResult} list for a Username token and return
  3. * the username if a Username Token found
  4. * @param results
  5. * @return
  6. */
  7. public static String getUsername(List<WSHandlerResult> results) {
  8. /*
  9. * Scan the results for a matching actor. Use results only if the
  10. * receiving Actor and the sending Actor match.
  11. */
  12. for (WSHandlerResult result : results) {
  13. List<WSSecurityEngineResult> wsSecEngineResults = result.getResults();
  14. /*
  15. * Scan the results for a username token. Use the username
  16. * of this token to set the alias for the encryption user
  17. */
  18. for (WSSecurityEngineResult wsSecEngineResult : wsSecEngineResults) {
  19. Integer actInt = (Integer) wsSecEngineResult.get(WSSecurityEngineResult.TAG_ACTION);
  20. if (actInt == WSConstants.UT) {
  21. WSUsernameTokenPrincipal principal = (WSUsernameTokenPrincipal) wsSecEngineResult.
  22. get(WSSecurityEngineResult.TAG_PRINCIPAL);
  23. return principal.getName();
  24. }
  25. }
  26. }
  27. return null;
  28. }

代码示例来源:origin: org.apache.servicemix/servicemix-cxf-bc

  1. WSUsernameTokenPrincipal p = (WSUsernameTokenPrincipal)er.get(WSSecurityEngineResult.TAG_PRINCIPAL);
  2. subject.getPrincipals().add(p);
  3. this.authenticationService.authenticate(subject, domain, p.getName(), p.getPassword());
  4. authenticated = true;

代码示例来源:origin: edu.internet2.middleware.grouper/grouper-ws

  1. userIdLoggedIn = principal.getName();
  2. break OUTER;

代码示例来源:origin: org.n52.security/52n-security-sts

  1. AuthenticationService authenticationService = securityConfig.getServiceConfig(STSAuthenticationService.SERVICENAME).getAuthenticationService();
  2. CredentialsCallbackHandler ccbh = new CredentialsCallbackHandler();
  3. ccbh.add(new UsernamePasswordCredential(token.getName(), token
  4. .getPassword()));
  5. AuthenticationContext authCxt = authenticationService.login(ccbh);

代码示例来源:origin: org.apache.rampart/rampart-core

  1. String username = userNameTokenPrincipal.getName();
  2. msgCtx.setProperty(RampartMessageData.USERNAME, username);

相关文章