public enum AuthLevel
extends java.lang.Enum<AuthLevel>
Enum to choose frontend authentication level for use in endpoints annotations. Frontend
authentication is handled by a Google API server prior to the request reaching backends. An early
return before hitting the backend can happen if the request does not fulfill the requirement
specified by the AuthLevel.
Authentication is optional and will be attempted if authentication credential are supplied. The
request can still reach backend if authentication failed.
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 (AuthLevel c : AuthLevel.values())
System.out.println(c);
Returns:
an array containing the constants of this enum type, in the order they are declared
valueOf
public static AuthLevel 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
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-28 UTC."],[[["\u003cp\u003e\u003ccode\u003eAuthLevel\u003c/code\u003e is an enum used to specify the frontend authentication level for endpoints annotations, determining whether authentication is required, optional, or skipped.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eAuthLevel\u003c/code\u003e enum has five constants: \u003ccode\u003eNONE\u003c/code\u003e (skips authentication), \u003ccode\u003eOPTIONAL\u003c/code\u003e (authentication is optional), \u003ccode\u003eOPTIONAL_CONTINUE\u003c/code\u003e (optional authentication attempted if credentials are provided), \u003ccode\u003eREQUIRED\u003c/code\u003e (authentication credentials required), and \u003ccode\u003eUNSPECIFIED\u003c/code\u003e (system default).\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003evalues()\u003c/code\u003e method returns an array of all \u003ccode\u003eAuthLevel\u003c/code\u003e constants in the order they are declared, enabling iteration over them.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003evalueOf(java.lang.String name)\u003c/code\u003e method returns the \u003ccode\u003eAuthLevel\u003c/code\u003e enum constant corresponding to the given string name, throwing exceptions for invalid or null names.\u003c/p\u003e\n"],["\u003cp\u003eFrontend authentication is handled by a Google API server, and requests may be rejected early if the specified \u003ccode\u003eAuthLevel\u003c/code\u003e requirement isn't met.\u003c/p\u003e\n"]]],[],null,["# AuthLevel\n\ncom.google.api.server.spi.config\n\nEnum AuthLevel\n--------------\n\n- java.lang.Object\n-\n - java.lang.Enum\\\u003c[AuthLevel](../../../../../../com/google/api/server/spi/config/AuthLevel.html \"enum in com.google.api.server.spi.config\")\\\u003e\n -\n - com.google.api.server.spi.config.AuthLevel\n\n-\n\n All Implemented Interfaces:\n : java.io.Serializable, java.lang.Comparable\\\u003c[AuthLevel](../../../../../../com/google/api/server/spi/config/AuthLevel.html \"enum in com.google.api.server.spi.config\")\\\u003e\n\n *** ** * ** ***\n\n \u003cbr /\u003e\n\n ```\n public enum AuthLevel\n extends java.lang.Enum\u003cAuthLevel\u003e\n ``` \nEnum to choose frontend authentication level for use in endpoints annotations. Frontend authentication is handled by a Google API server prior to the request reaching backends. An early return before hitting the backend can happen if the request does not fulfill the requirement specified by the AuthLevel. \n-\n -\n\n ### Enum Constant Summary\n\n \u003c!-- --\u003e\n\n -\n\n ### Method Summary\n\n -\n\n ### Methods inherited from class java.lang.Enum\n\n `clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`\n\n \u003c!-- --\u003e\n\n -\n\n ### Methods inherited from class java.lang.Object\n\n`getClass, notify, notifyAll, wait, wait, wait` \n-\n -\n\n ### Enum Constant Detail\n\n\n -\n\n #### REQUIRED\n\n ```\n public static final AuthLevel REQUIRED\n ``` \n Valid authentication credentials are required.\n\n\n -\n\n #### OPTIONAL\n\n ```\n public static final AuthLevel OPTIONAL\n ``` \n Authentication is optional. If authentication credentials are supplied they must be valid.\n\n\n -\n\n #### OPTIONAL_CONTINUE\n\n ```\n public static final AuthLevel OPTIONAL_CONTINUE\n ``` \n Authentication is optional and will be attempted if authentication credential are supplied. The request can still reach backend if authentication failed.\n\n\n -\n\n #### NONE\n\n ```\n public static final AuthLevel NONE\n ``` \n Frontend authentication will be skipped. Existing authentication in cloud endpoints still applies.\n\n\n -\n\n #### UNSPECIFIED\n\n ```\n public static final AuthLevel UNSPECIFIED\n ``` \n Unspecified; AuthLevel is system default if there is any.\n\n \u003c!-- --\u003e\n\n -\n\n ### Method Detail\n\n\n -\n\n #### values\n\n ```\n public static AuthLevel[] values()\n ``` \n 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: \n\n ```\n for (AuthLevel c : AuthLevel.values())\n System.out.println(c);\n ```\n\n Returns:\n : an array containing the constants of this enum type, in the order they are declared\n\n\n -\n\n #### valueOf\n\n ```\n public static AuthLevel valueOf(java.lang.String name)\n ``` \n 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.)\n\n Parameters:\n : `name` - the name of the enum constant to be returned.\n\n Returns:\n : the enum constant with the specified name\n\n Throws:\n : `java.lang.IllegalArgumentException` - if this enum type has no constant with the specified name\n : `java.lang.NullPointerException` - if the argument is null"]]