package user
import "google.golang.org/appengine/user"
Package user provides a client for App Engine's user authentication service.
Index ¶
- func IsAdmin(c context.Context) bool
- func LoginURL(c context.Context, dest string) (string, error)
- func LoginURLFederated(c context.Context, dest, identity string) (string, error)
- func LogoutURL(c context.Context, dest string) (string, error)
- func OAuthConsumerKey(c context.Context) (string, error)
- type User
Functions ¶
func IsAdmin ¶
IsAdmin returns true if the current user is signed in and is currently registered as an administrator of the application.
func LoginURL ¶
LoginURL returns a URL that, when visited, prompts the user to sign in, then redirects the user to the URL specified by dest.
func LoginURLFederated ¶
LoginURLFederated is like LoginURL but accepts a user's OpenID identifier.
func LogoutURL ¶
LogoutURL returns a URL that, when visited, signs the user out, then redirects the user to the URL specified by dest.
func OAuthConsumerKey ¶
OAuthConsumerKey returns the OAuth consumer key provided with the current request. This method will return an error if the OAuth request was invalid.
Types ¶
type User ¶
type User struct { Email string AuthDomain string Admin bool // ID is the unique permanent ID of the user. // It is populated if the Email is associated // with a Google account, or empty otherwise. ID string // 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. ClientID string FederatedIdentity string FederatedProvider string }
User represents a user of the application.
func Current ¶
Current returns the currently logged-in user, or nil if the user is not signed in.
func CurrentOAuth ¶
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.
func (*User) String ¶
String returns a displayable name for the user.
Source Files ¶
oauth.go user.go user_vm.go
- Version
- v1.6.2
- Published
- Aug 28, 2019
- Platform
- linux/amd64
- Imports
- 5 packages
- Last checked
- 10 hours ago –
Tools for package owners.