# Authenticator

<div class="jsdoc-content"><header>
    
        <h2><span class="attribs"><span class="type-signature"></span></span>
            <span class="ancestors"><a href="index.html">auth</a>~</span>Authenticator<span class="signature">()</span><span class="type-signature"></span></h2>
        
            <div class="class-description"><p>Handles SASL authentication with Cassandra servers.
Each time a new connection is created and the server requires authentication,
a new instance of this class will be created by the corresponding.</p></div>
        
    
</header>


    
        

    
    </div>

## Constructor

<div class="jsdoc-content">
    

    
    <h4 class="name" id="Authenticator"><span class="type-signature"></span>new Authenticator<span class="signature">()</span><span class="type-signature"></span></h4>
    

    















<div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.6.1/lib/auth/provider.js#L32" target="_blank" rel="noopener">auth/provider.js, line 32</a></p></div>




















    
    

    

    

    

    

    

    

    

    
        </div>

## Methods

<div class="jsdoc-content">

        
            

    

    
    <h4 class="name" id="evaluateChallenge"><span class="type-signature"></span>evaluateChallenge<span class="signature">(challenge, callback)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Evaluates a challenge received from the Server. Generally, this method should callback with
no error and no additional params when authentication is complete from the client perspective.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params docutils align-default">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>challenge</code></td>
            

            <td class="type">
            
                
<span class="param-type">Buffer</span>


            
            </td>

            

            

            <td class="description last"></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>callback</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last"></td>
        </tr>

    
    </tbody>
</table>






<div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.6.1/lib/auth/provider.js#L48" target="_blank" rel="noopener">auth/provider.js, line 48</a></p></div>




















        
            

    

    
    <h4 class="name" id="initialResponse"><span class="type-signature"></span>initialResponse<span class="signature">(callback)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Obtain an initial response token for initializing the SASL handshake.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params docutils align-default">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>callback</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last"></td>
        </tr>

    
    </tbody>
</table>






<div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.6.1/lib/auth/provider.js#L38" target="_blank" rel="noopener">auth/provider.js, line 38</a></p></div>




















        
            

    

    
    <h4 class="name" id="onAuthenticationSuccess"><span class="type-signature"></span>onAuthenticationSuccess<span class="signature">(token<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Called when authentication is successful with the last information
optionally sent by the server.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params docutils align-default">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>token</code></td>
            

            <td class="type">
            
                
<span class="param-type">Buffer</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last"></td>
        </tr>

    
    </tbody>
</table>






<div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.6.1/lib/auth/provider.js#L57" target="_blank" rel="noopener">auth/provider.js, line 57</a></p></div></div>
