当前位置: 首页>>代码示例>>Java>>正文


Java AuthException.getMessage方法代码示例

本文整理汇总了Java中javax.security.auth.message.AuthException.getMessage方法的典型用法代码示例。如果您正苦于以下问题:Java AuthException.getMessage方法的具体用法?Java AuthException.getMessage怎么用?Java AuthException.getMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.security.auth.message.AuthException的用法示例。


在下文中一共展示了AuthException.getMessage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: secureResponse

import javax.security.auth.message.AuthException; //导入方法依赖的package包/类
public void secureResponse(SoapMessage message)
{
   SOAPMessage request = message.getExchange().getInMessage().get(SOAPMessage.class);
   SOAPMessage response = message.getContent(SOAPMessage.class);
   MessageInfo messageInfo = new GenericMessageInfo(request, response);
   AuthStatus authStatus = null;
   try
   {
      authStatus = sctx.secureResponse(messageInfo, null);
   }
   catch (AuthException e)
   {
      if (isSOAP12(message))
      {
         SoapFault soap12Fault = new SoapFault(e.getMessage(), Soap12.getInstance().getReceiver());
         throw soap12Fault;
      }
      else
      {
         throw new SoapFault(e.getMessage(), new QName("", "jaspi AuthException"));
      }
   }
   if (messageInfo.getResponseMessage() != null && !message.getExchange().isOneWay())
   {
      if (AuthStatus.SEND_CONTINUE == authStatus)
      {
         message.put(Message.RESPONSE_CODE, Integer.valueOf(303));
      }
      if (AuthStatus.SEND_FAILURE == authStatus)
      {
         message.put(Message.RESPONSE_CODE, Integer.valueOf(500));
      }
   }

}
 
开发者ID:jbossws,项目名称:jbossws-cxf,代码行数:36,代码来源:JaspiServerAuthenticator.java

示例2: secureRequest

import javax.security.auth.message.AuthException; //导入方法依赖的package包/类
public void secureRequest(SoapMessage message)
{
   SOAPMessage soapMessage = message.getContent(SOAPMessage.class);
   MessageInfo messageInfo = new GenericMessageInfo(soapMessage, null);
   String authContextID = clientConfig.getAuthContextID(messageInfo);

   Properties serverContextProperties = new Properties();
   serverContextProperties.put("security-domain", securityDomain);
   serverContextProperties.put("jaspi-policy", jpi);
   Subject clientSubject = new Subject();
   @SuppressWarnings("unused")
   AuthStatus authStatus = null;
   try
   {
      ClientAuthContext cctx = clientConfig.getAuthContext(authContextID, clientSubject, serverContextProperties);
      authStatus = cctx.secureRequest(messageInfo, clientSubject);
   }
   catch (AuthException e)
   {
      if (isSOAP12(message))
      {
         SoapFault soap12Fault = new SoapFault(e.getMessage(), Soap12.getInstance().getSender());
         throw soap12Fault;
      }
      else
      {
         throw new SoapFault(e.getMessage(), new QName("", "japsi AuthException"));
      }
   }
   //TODO:look at how to handle AuthStatus

}
 
开发者ID:jbossws,项目名称:jbossws-cxf,代码行数:33,代码来源:JaspiClientAuthenticator.java

示例3: validateResponse

import javax.security.auth.message.AuthException; //导入方法依赖的package包/类
public void validateResponse(SoapMessage message)
{
   SOAPMessage request = message.getExchange().getInMessage().get(SOAPMessage.class);
   SOAPMessage response = message.getContent(SOAPMessage.class);
   MessageInfo messageInfo = new GenericMessageInfo(request, response);
   String authContextID = clientConfig.getAuthContextID(messageInfo);

   Properties serverContextProperties = new Properties();
   serverContextProperties.put("security-domain", securityDomain);
   serverContextProperties.put("jaspi-policy", jpi);
   Subject clientSubject = new Subject();
   @SuppressWarnings("unused")
   AuthStatus authStatus = null;
   try
   {
      ClientAuthContext sctx = clientConfig.getAuthContext(authContextID, clientSubject, serverContextProperties);
      authStatus = sctx.validateResponse(messageInfo, new Subject(), new Subject());
   }
   catch (AuthException e)
   {
      if (isSOAP12(message))
      {
         SoapFault soap12Fault = new SoapFault(e.getMessage(), Soap12.getInstance().getSender());
         throw soap12Fault;
      }
      else
      {
         throw new SoapFault(e.getMessage(), new QName("", "japsi AuthException"));
      }
   }
   //TODO:handle AuthStatus

}
 
开发者ID:jbossws,项目名称:jbossws-cxf,代码行数:34,代码来源:JaspiClientAuthenticator.java


注:本文中的javax.security.auth.message.AuthException.getMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。