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


Java BindResponse.setServerSaslCreds方法代码示例

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


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

示例1: action

import org.apache.directory.api.ldap.model.message.BindResponse; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
public void action( LdapMessageContainer<BindResponseDecorator> container ) throws DecoderException
{
    // Get the Value and store it in the BindRequest
    TLV tlv = container.getCurrentTLV();

    // We have to handle the special case of a 0 length server
    // sasl credentials
    byte[] serverSaslCreds;

    if ( tlv.getLength() == 0 )
    {
        serverSaslCreds = Strings.EMPTY_BYTES;
    }
    else
    {
        serverSaslCreds = tlv.getValue().getData();
    }

    BindResponse response = container.getMessage();
    response.setServerSaslCreds( serverSaslCreds );

    // We can have an END transition
    container.setGrammarEndAllowed( true );

    if ( IS_DEBUG )
    {
        LOG.debug( "The SASL credentials value is : {}", Strings.dumpBytes( serverSaslCreds ) );
    }
}
 
开发者ID:apache,项目名称:directory-ldap-api,代码行数:33,代码来源:StoreServerSASLCreds.java

示例2: sendBindSuccess

import org.apache.directory.api.ldap.model.message.BindResponse; //导入方法依赖的package包/类
/**
 * Send a SUCCESS message back to the client.
 */
private void sendBindSuccess( LdapSession ldapSession, BindRequest bindRequest, byte[] tokenBytes )
{
    // Return the successful response
    BindResponse response = bindRequest.getResultResponse();
    response.getLdapResult().setResultCode( ResultCodeEnum.SUCCESS );
    response.setServerSaslCreds( tokenBytes );

    if ( !ldapSession.getCoreSession().isAnonymous() )
    {
        // If we have not been asked to authenticate as Anonymous, authenticate the user
        ldapSession.setAuthenticated();
    }
    else
    {
        // Otherwise, switch back to Anonymous
        ldapSession.setAnonymous();
    }

    // Clean the SaslProperties, we don't need them anymore
    MechanismHandler handler = ( MechanismHandler ) ldapSession.getSaslProperty( SaslConstants.SASL_MECH_HANDLER );

    if ( handler != null )
    {
        handler.cleanup( ldapSession );
    }

    ldapSession.getIoSession().write( response );

    LOG.debug( "Returned SUCCESS message: {}.", response );
}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:34,代码来源:BindRequestHandler.java

示例3: sendBindSuccess

import org.apache.directory.api.ldap.model.message.BindResponse; //导入方法依赖的package包/类
/**
 * Send a SUCCESS message back to the client.
 */
private void sendBindSuccess( LdapSession ldapSession, BindRequest bindRequest, byte[] tokenBytes )
{
    // Return the successful response
    BindResponse response = ( BindResponse ) bindRequest.getResultResponse();
    response.getLdapResult().setResultCode( ResultCodeEnum.SUCCESS );
    response.setServerSaslCreds( tokenBytes );

    if ( !ldapSession.getCoreSession().isAnonymous() )
    {
        // If we have not been asked to authenticate as Anonymous, authenticate the user
        ldapSession.setAuthenticated();
    }
    else
    {
        // Otherwise, switch back to Anonymous
        ldapSession.setAnonymous();
    }

    // Clean the SaslProperties, we don't need them anymore
    MechanismHandler handler = ( MechanismHandler ) ldapSession.getSaslProperty( SaslConstants.SASL_MECH_HANDLER );

    if ( handler != null )
    {
        handler.cleanup( ldapSession );
    }

    ldapSession.getIoSession().write( response );

    LOG.debug( "Returned SUCCESS message: {}.", response );
}
 
开发者ID:TremoloSecurity,项目名称:MyVirtualDirectory,代码行数:34,代码来源:BindRequestHandler.java


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