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


Java BindRequest.getSaslMechanism方法代码示例

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


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

示例1: handleSaslAuthPending

import org.apache.directory.api.ldap.model.message.BindRequest; //导入方法依赖的package包/类
private void handleSaslAuthPending( LdapSession ldapSession, BindRequest bindRequest ) throws Exception
{
    // First, check that we have the same mechanism
    String saslMechanism = bindRequest.getSaslMechanism();

    // The empty mechanism is also a request for a new Bind session
    if ( Strings.isEmpty( saslMechanism )
        || !ldapSession.getSaslProperty( SaslConstants.SASL_MECH ).equals( saslMechanism ) )
    {
        sendAuthMethNotSupported( ldapSession, bindRequest );
        return;
    }

    // We have already received a first BindRequest, and sent back some challenge.
    // First, check if the mechanism is the same
    MechanismHandler mechanismHandler = handlers.get( saslMechanism );

    if ( mechanismHandler == null )
    {
        String message = I18n.err( I18n.ERR_161, saslMechanism );

        // Clear the saslProperties, and move to the anonymous state
        ldapSession.clearSaslProperties();
        ldapSession.setAnonymous();

        LOG.error( message );
        throw new IllegalArgumentException( message );
    }

    // Get the previously created SaslServer instance
    SaslServer ss = mechanismHandler.handleMechanism( ldapSession, bindRequest );

    generateSaslChallengeOrComplete( ldapSession, ss, bindRequest );
}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:35,代码来源:BindRequestHandler.java


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