com.smartgwt.client.types

## Enum RESTAuthenticationType

- java.lang.Object
- - java.lang.Enum<RESTAuthenticationType>
  - - com.smartgwt.client.types.RESTAuthenticationType

- All Implemented Interfaces:
    ValueEnum, java.io.Serializable, java.lang.Comparable<RESTAuthenticationType>

      public enum RESTAuthenticationType
      extends java.lang.Enum<RESTAuthenticationType>
      implements ValueEnum

  Enumeration of the supported authentication types for the `RestConnector` implementation. Note, all of these authentication types are secure, but only if you use HTTPS

- - ### Enum Constant Summary

    Enum Constants
    Enum Constant and Description
    `AUTHHEADER` Use a manually-constructed HTTP Authorization header.
    `BASIC` Use a "Basic" HTTP Authorization header.
    `BEARERTOKEN` Use a "Bearer" HTTP Authorization header with a bearer token obtained from an OAuth 2.0 client credentials server or other auth scheme that can generate bearer tokens (also known as API tokens or API keys).

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getValue()`
    `static RESTAuthenticationType` | `valueOf(java.lang.String name)` Returns the enum constant of this type with the specified name.
    `static RESTAuthenticationType[]` | `values()` Returns an array containing the constants of this enum type, in the order they are declared.

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

      `clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

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

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Enum Constant Detail

    - #### BASIC

          public static final RESTAuthenticationType BASIC

      Use a "Basic" HTTP Authorization header. Requires both a `username` and a `password`, which are combined and Base64-encoded in the HTTP request header. Note, you can also use this auth type for services that allow for Basic authentication using a combination of user and long-lived API key (ie, an API key or token that is generated by the auth server and is used instead of a password for this particular client application, but does not need to be regularly renewed)

      If this enumerated value is used in a `Component XML` file or server-side DataSource descriptor (.ds.xml file), use the value "basic".

    - #### BEARERTOKEN

          public static final RESTAuthenticationType BEARERTOKEN

      Use a "Bearer" HTTP Authorization header with a bearer token obtained from an OAuth 2.0 client credentials server or other auth scheme that can generate bearer tokens (also known as API tokens or API keys). This auth type can handle both long-lived tokens, such as API keys that are generated once for an application and never change, and so-called "access tokens" that are only valid for a limited period of time - usually no more than a few hours - and must be refreshed when they expire. See `RESTAuthentication.dataSource`

      If this enumerated value is used in a `Component XML` file or server-side DataSource descriptor (.ds.xml file), use the value "bearerToken".

    - #### AUTHHEADER

          public static final RESTAuthenticationType AUTHHEADER

      Use a manually-constructed HTTP Authorization header. This auth type requires an `authentication dataSource` that returns a record containing a well-formed Authorization header value in a field called "authorizationHeader" (this can be overridden, see the authentication dataSource docs mentioned above)

      If this enumerated value is used in a `Component XML` file or server-side DataSource descriptor (.ds.xml file), use the value "authHeader".

  - ### Method Detail

    - #### values

          public static RESTAuthenticationType[] values()

      Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

          for (RESTAuthenticationType c : RESTAuthenticationType.values())
              System.out.println(c);

      Returns:
        an array containing the constants of this enum type, in the order they are declared

    - #### valueOf

          public static RESTAuthenticationType valueOf(java.lang.String name)

      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
        `name` - the name of the enum constant to be returned.
      Returns:
        the enum constant with the specified name
      Throws:
        `java.lang.IllegalArgumentException` - if this enum type has no constant with the specified name
        `java.lang.NullPointerException` - if the argument is null

    - #### getValue

          public java.lang.String getValue()

      Specified by:
        `getValue` in interface `ValueEnum`