Go 1.11 has reached end of support
and will bedeprecatedon January 31, 2026. After deprecation, you won't be able to deploy Go 1.11
applications, even if your organization previously used an organization policy to
re-enable deployments of legacy runtimes. Your existing Go
1.11 applications will continue to run and receive traffic after theirdeprecation date. We
recommend that youmigrate to the latest supported version of Go.
OAuthConsumerKey returns the OAuth consumer key provided with the current
request. This method will return an error if the OAuth request was invalid.
User
typeUserstruct{EmailstringAuthDomainstringAdminbool// ID is the unique permanent ID of the user.// It is populated if the Email is associated// with a Google account, or empty otherwise.IDstring// ClientID is the ID of the pre-registered client so its identity can be verified.// See https://developers.google.com/console/help/#generatingoauth2 for more information.ClientIDstringFederatedIdentitystringFederatedProviderstring}
CurrentOAuth returns the user associated with the OAuth consumer making this
request. If the OAuth consumer did not make a valid OAuth request, or the
scopes is non-empty and the current user does not have at least one of the
scopes, this method will return an error.
[[["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-09-04 UTC."],[[["\u003cp\u003eThis package, \u003ccode\u003euser\u003c/code\u003e, provides functionality for App Engine's user authentication service.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eIsAdmin\u003c/code\u003e function checks if the current user is signed in and registered as an administrator.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eLoginURL\u003c/code\u003e and \u003ccode\u003eLoginURLFederated\u003c/code\u003e functions generate URLs for users to sign in, with the latter supporting OpenID identifiers.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eLogoutURL\u003c/code\u003e function creates a URL to sign a user out and redirect them to a specified destination.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eCurrent\u003c/code\u003e function retrieves the currently logged-in user, or nil if no user is signed in, while \u003ccode\u003eCurrentOAuth\u003c/code\u003e retrieves a user based on a valid OAuth request.\u003c/p\u003e\n"]]],[],null,["# Package google.golang.org/appengine/user (v1.6.7)\n\nVersion 1.6.7keyboard_arrow_down\n\n- [1.6.8 (latest)](/appengine/docs/legacy/standard/go111/reference/latest/user)\n- [1.6.7](/appengine/docs/legacy/standard/go111/reference/1.6.7/user) \n**Note:** To get more information about this package, such as access to older versions, view [this package on pkg.go.dev](https://pkg.go.dev/google.golang.org/appengine/user). \n\u003cbr /\u003e\n\nPackage user provides a client for App Engine's user authentication service. \n\nFunctions\n---------\n\n### func IsAdmin\n\n func IsAdmin(c https://pkg.go.dev/golang.org/x/net/context.https://pkg.go.dev/golang.org/x/net/context#Context) https://pkg.go.dev/builtin#bool\n\nIsAdmin returns true if the current user is signed in and\nis currently registered as an administrator of the application. \n\n### func LoginURL\n\n func LoginURL(c https://pkg.go.dev/golang.org/x/net/context.https://pkg.go.dev/golang.org/x/net/context#Context, dest https://pkg.go.dev/builtin#string) (https://pkg.go.dev/builtin#string, https://pkg.go.dev/builtin#error)\n\nLoginURL returns a URL that, when visited, prompts the user to sign in,\nthen redirects the user to the URL specified by dest. \n\n### func LoginURLFederated\n\n func LoginURLFederated(c https://pkg.go.dev/golang.org/x/net/context.https://pkg.go.dev/golang.org/x/net/context#Context, dest, identity https://pkg.go.dev/builtin#string) (https://pkg.go.dev/builtin#string, https://pkg.go.dev/builtin#error)\n\nLoginURLFederated is like LoginURL but accepts a user's OpenID identifier. \n\n### func LogoutURL\n\n func LogoutURL(c https://pkg.go.dev/golang.org/x/net/context.https://pkg.go.dev/golang.org/x/net/context#Context, dest https://pkg.go.dev/builtin#string) (https://pkg.go.dev/builtin#string, https://pkg.go.dev/builtin#error)\n\nLogoutURL returns a URL that, when visited, signs the user out,\nthen redirects the user to the URL specified by dest. \n\n### func OAuthConsumerKey\n\n func OAuthConsumerKey(c https://pkg.go.dev/golang.org/x/net/context.https://pkg.go.dev/golang.org/x/net/context#Context) (https://pkg.go.dev/builtin#string, https://pkg.go.dev/builtin#error)\n\nOAuthConsumerKey returns the OAuth consumer key provided with the current\nrequest. This method will return an error if the OAuth request was invalid. \n\nUser\n----\n\n type User struct {\n \tEmail https://pkg.go.dev/builtin#string\n \tAuthDomain https://pkg.go.dev/builtin#string\n \tAdmin https://pkg.go.dev/builtin#bool\n\n \t// ID is the unique permanent ID of the user.\n \t// It is populated if the Email is associated\n \t// with a Google account, or empty otherwise.\n \tID https://pkg.go.dev/builtin#string\n\n \t// ClientID is the ID of the pre-registered client so its identity can be verified.\n \t// See https://developers.google.com/console/help/#generatingoauth2 for more information.\n \tClientID https://pkg.go.dev/builtin#string\n\n \tFederatedIdentity https://pkg.go.dev/builtin#string\n \tFederatedProvider https://pkg.go.dev/builtin#string\n }\n\nUser represents a user of the application. \n\n### func Current\n\n func Current(c https://pkg.go.dev/golang.org/x/net/context.https://pkg.go.dev/golang.org/x/net/context#Context) *#google_golang_org_appengine_user_User\n\nCurrent returns the currently logged-in user,\nor nil if the user is not signed in. \n\n### func CurrentOAuth\n\n func CurrentOAuth(c https://pkg.go.dev/golang.org/x/net/context.https://pkg.go.dev/golang.org/x/net/context#Context, scopes https://pkg.go.dev/builtin#string) (*#google_golang_org_appengine_user_User, https://pkg.go.dev/builtin#error)\n\nCurrentOAuth returns the user associated with the OAuth consumer making this\nrequest. If the OAuth consumer did not make a valid OAuth request, or the\nscopes is non-empty and the current user does not have at least one of the\nscopes, this method will return an error. \n\n### func (\\*User) String\n\n func (u *#google_golang_org_appengine_user_User) String() https://pkg.go.dev/builtin#string\n\nString returns a displayable name for the user."]]