org.labkey.remoteapi

## Class NetrcCredentialsProvider

- java.lang.Object
- - org.labkey.remoteapi.NetrcCredentialsProvider

- All Implemented Interfaces:
    CredentialsProvider

      public class NetrcCredentialsProvider
      extends java.lang.Object
      implements CredentialsProvider

  Attempts to find a .netrc or _netrc file and entry for the given host. If found, it will attempt basic auth using the email and password in the entry. If file or entry are not found, it connects as guest.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `NetrcCredentialsProvider(java.lang.String host)` Attempt netrc lookup for the given host.
    `NetrcCredentialsProvider(java.net.URI baseURI)` Attempt netrc lookup for the URI's host.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `configureRequest(java.lang.String baseUrl, org.apache.http.client.methods.HttpUriRequest request, org.apache.http.client.protocol.HttpClientContext httpClientContext)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### NetrcCredentialsProvider

          public NetrcCredentialsProvider(java.net.URI baseURI)
                                   throws java.io.IOException

      Attempt netrc lookup for the URI's host.
      Parameters:
        `baseURI` - A valid base URI from which we'll extract the host name.
      Throws:
        `java.io.IOException`

    - #### NetrcCredentialsProvider

          public NetrcCredentialsProvider(java.lang.String host)
                                   throws java.io.IOException

      Attempt netrc lookup for the given host.
      Parameters:
        `host` - Just the host name, e.g., "www.labkey.org" or "localhost"
      Throws:
        `java.io.IOException`

  - ### Method Detail

    - #### configureRequest

          public void configureRequest(java.lang.String baseUrl,
                                       org.apache.http.client.methods.HttpUriRequest request,
                                       org.apache.http.client.protocol.HttpClientContext httpClientContext)
                                throws org.apache.http.auth.AuthenticationException,
                                       java.net.URISyntaxException

      Specified by:
        `configureRequest` in interface `CredentialsProvider`
      Throws:
        `org.apache.http.auth.AuthenticationException`
        `java.net.URISyntaxException`