# PlainTextAuthProvider

<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>PlainTextAuthProvider<span class="signature">(username, password)</span><span class="type-signature"></span></h2>
        
            <div class="class-description"><p>Provides plain text <a href="Authenticator.html">Authenticator</a> instances to be used when
connecting to a host.</p></div>
        
    
</header>


    
        

    
    </div>

## Constructor

<div class="jsdoc-content">
    

    
    <h4 class="name" id="PlainTextAuthProvider"><span class="type-signature"></span>new PlainTextAuthProvider<span class="signature">(username, password)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Creates a new instance of the Authenticator provider</p>
</div>



    <h5>Extends:</h5>
    


    <ul>
        <li><a href="AuthProvider.html">module:auth~AuthProvider</a></li>
    </ul>









    <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>username</code></td>
            

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


            
            </td>

            

            

            <td class="description last"><p>User name in plain text</p></td>
        </tr>

    

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

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


            
            </td>

            

            

            <td class="description last"><p>Password in plain text</p></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/plain-text-auth-provider.js#L18" target="_blank" rel="noopener">auth/plain-text-auth-provider.js, line 18</a></p></div>



















    <h5>Example</h5>
    
    <div class="highlight-javascript notranslate"><div class="highlight"><pre>var authProvider = new cassandra.auth.PlainTextAuthProvider('my_user', 'p@ssword1!');
//Set the auth provider in the clientOptions when creating the Client instance
const client = new Client({ contactPoints: contactPoints, authProvider: authProvider });</pre></div></div>



    
    

    
        </div>

## Extends

<div class="jsdoc-content">

        


    <ul>
        <li><a href="AuthProvider.html">module:auth~AuthProvider</a></li>
    </ul>


    

    

    

    

    

    

    

    
        </div>

## Methods

<div class="jsdoc-content">

        
            

    

    
    <h4 class="name" id="newAuthenticator"><span class="type-signature"></span>newAuthenticator<span class="signature">(endpoint, name)</span><span class="type-signature"> &rarr; {Authenticator}</span></h4>
    

    



<div class="description">
    <p>Returns a new <a href="Authenticator.html">Authenticator</a> instance to be used for plain text authentication.</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>endpoint</code></td>
            

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


            
            </td>

            

            

            <td class="description last"><p>The ip address and port number in the format ip:port</p></td>
        </tr>

    

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

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


            
            </td>

            

            

            <td class="description last"><p>Authenticator name</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    
    <dt class="tag-overrides">Overrides:</dt>
    <dd class="tag-overrides"><ul class="dummy"><li>
        <a href="AuthProvider.html#newAuthenticator">module:auth~AuthProvider#newAuthenticator</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    

    
    
    

    

    

    
</dl><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/plain-text-auth-provider.js#L34" target="_blank" rel="noopener">auth/plain-text-auth-provider.js, line 34</a></p></div>















<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Authenticator</span>


    </dd>
</dl></div>
