[[["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\u003eUnauthorizedException\u003c/code\u003e is a class that extends \u003ccode\u003eServiceException\u003c/code\u003e and is used to represent a 401 unauthorized response.\u003c/p\u003e\n"],["\u003cp\u003eThe class provides multiple constructors to create an \u003ccode\u003eUnauthorizedException\u003c/code\u003e with different combinations of messages, reasons, domains, authentication schemes, and parameters.\u003c/p\u003e\n"],["\u003cp\u003eIt includes a static field \u003ccode\u003eAUTH_SCHEME_BEARER\u003c/code\u003e, which likely represents a common authorization scheme.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egetHeaders()\u003c/code\u003e method is available within this class, which returns a map of string key-value pairs.\u003c/p\u003e\n"]]],[],null,["# UnauthorizedException\n\ncom.google.api.server.spi.response\n\nClass UnauthorizedException\n---------------------------\n\n- java.lang.Object\n-\n - ServiceException\n -\n - com.google.api.server.spi.response.UnauthorizedException\n\n-\n\n *** ** * ** ***\n\n \u003cbr /\u003e\n\n ```\n public class UnauthorizedException\n extends ServiceException\n ``` \nUnauthorized exception that is mapped to a 401 response. \n-\n -\n\n ### Field Summary\n\n \u003c!-- --\u003e\n\n -\n\n ### Constructor Summary\n\n \u003c!-- --\u003e\n\n -\n\n ### Method Summary\n\n -\n\n ### Methods inherited from class java.lang.Object\n\n`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait` \n-\n -\n\n ### Field Detail\n\n\n -\n\n #### AUTH_SCHEME_BEARER\n\n ```\n public static final java.lang.String AUTH_SCHEME_BEARER\n ```\n\n See Also:\n : [Constant Field Values](../../../../../../constant-values.html#com.google.api.server.spi.response.UnauthorizedException.AUTH_SCHEME_BEARER)\n\n \u003c!-- --\u003e\n\n -\n\n ### Constructor Detail\n\n\n -\n\n #### UnauthorizedException\n\n ```\n public UnauthorizedException(java.lang.String message)\n ```\n\n\n -\n\n #### UnauthorizedException\n\n ```\n public UnauthorizedException(java.lang.Throwable cause)\n ```\n\n\n -\n\n #### UnauthorizedException\n\n ```\n public UnauthorizedException(java.lang.String message,\n java.lang.Throwable cause)\n ```\n\n\n -\n\n #### UnauthorizedException\n\n ```\n public UnauthorizedException(java.lang.String statusMessage,\n java.lang.String reason)\n ```\n\n\n -\n\n #### UnauthorizedException\n\n ```\n public UnauthorizedException(java.lang.String statusMessage,\n java.lang.String reason,\n java.lang.Throwable cause)\n ```\n\n\n -\n\n #### UnauthorizedException\n\n ```\n public UnauthorizedException(java.lang.String statusMessage,\n java.lang.String reason,\n java.lang.String domain)\n ```\n\n\n -\n\n #### UnauthorizedException\n\n ```\n public UnauthorizedException(java.lang.String statusMessage,\n java.lang.String reason,\n java.lang.String domain,\n java.lang.Throwable cause)\n ```\n\n\n -\n\n #### UnauthorizedException\n\n ```\n public UnauthorizedException(java.lang.String message,\n java.lang.String authScheme,\n java.util.Map\u003cjava.lang.String,java.lang.String\u003e params)\n ``` \n Creates an UnauthorizedException.\n\n Parameters:\n : `message` - Error message to return\n : `authScheme` - Auth scheme in the WWW-Authenticate header\n : `params` - Parameters in the WWW-Authenticate header\n\n\n -\n\n #### UnauthorizedException\n\n ```\n public UnauthorizedException(java.lang.String message,\n java.lang.String reason,\n java.lang.String domain,\n java.lang.String authScheme,\n java.util.Map\u003cjava.lang.String,java.lang.String\u003e params)\n ```\n\n \u003c!-- --\u003e\n\n -\n\n ### Method Detail\n\n\n -\n\n #### getHeaders\n\n ```\n public java.util.Map\u003cjava.lang.String,java.lang.String\u003e getHeaders()\n ```"]]