use google\appengine\api\users\User;use google\appengine\api\users\UserService;$user = UserService::getCurrentUser();if (isset($user)) { echo sprintf('Welcome, %s! (<a href="%s">sign out</a>)', $user->getNickname(), UserService::createLogoutUrl('/'));} else { echo sprintf('<a href="%s">Sign in or register</a>', UserService::createLoginUrl('/'));}
開発用ウェブサーバーは、独自のログイン設備とログアウト設備を使用して Google アカウントをシミュレートします。開発用ウェブサーバー上のアプリケーションにログインする場合、サーバーにより、そのセッションで使用するメールアドレスを入力するように求められます。詳細については、開発用ウェブサーバーをご覧ください。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-03-06 UTC。"],[[["The Users API allows developers to create URLs for user sign-in and sign-out actions, redirecting them back to the application afterward."],["`UserService::createLoginUrl()` and `UserService::createLogoutUrl()` functions generate the URLs for signing in and out, respectively, while requiring a destination URL for redirection."],["The development web server simulates Google Accounts with its sign-in/sign-out mechanisms, prompting for an email address when signing in locally."],["Access to specific parts of an application can be restricted to signed-in users using the `login: required` configuration element for URL handlers."],["This API is specific to first-generation runtimes in the App Engine standard environment and has different options in later versions."]]],[]]