限定使用アクセス トークン
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
制限付きアクセス トークンは、リクエストのなりすましやリプレイ攻撃から保護され、メールが送信されたユーザーによって確実に実行されます。保護を実現するために、リクエスト パラメータに一意のトークン パラメータを追加し、アクションが呼び出されたときにそれを検証します。
トークン パラメータは、特定のアクションと特定のユーザーに対してのみ使用できるキーとして生成する必要があります。リクエストされたアクションを実行する前に、トークンが有効であり、ユーザーに対して生成したトークンと一致していることを確認する必要があります。トークンが一致した場合、アクションを実行できます。トークンは今後のリクエストで無効になります。
アクセス トークンは、HttpActionHandler の url
プロパティの一部としてユーザーに送信する必要があります。たとえば、アプリケーションが http://www.example.com/approve?requestId=123
で承認リクエストを処理する場合は、追加の accessToken
パラメータを追加して、http://www.example.com/approve?requestId=123&accessToken=xyz
に送信されるリクエストをリッスンすることを検討してください。
requestId=123
と accessToken=xyz
の組み合わせは事前に生成する必要があるものであり、accessToken
が requestId
から推測されないようにします。requestId=123
が accessToken
の承認リクエスト、または accessToken
が xyz
でない承認リクエストは拒否されます。このリクエストが完了すると、同じ ID とアクセス トークンを持つ今後のリクエストも拒否されます。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-07-25 UTC。
[null,null,["最終更新日 2025-07-25 UTC。"],[],[],null,["# Limited Use Access Tokens\n\nLimited-Use Access Tokens provide protection from request spoofing and [replay attacks](http://en.wikipedia.org/wiki/Replay_attack), ensuring that the action is performed by the user the message was sent to. Protection is achieved by adding a unique token parameter to the request parameters and verifying it when the action is invoked.\n\nThe token parameter should be generated as a key that can only be used for a specific action and a specific user. Before the requested action is performed, you should check that the token is valid and matches the one you generated for the user. If the token matches then the action can be performed and the token becomes invalid for future requests.\n\nAccess tokens should be sent to the user as part of the `url` property of the [HttpActionHandler](/workspace/gmail/markup/reference/types/HttpActionHandler). For instance, if your application handles approval requests at `http://www.example.com/approve?requestId=123`, you should consider including an additional `accessToken` parameter to it and listen to requests sent to `http://www.example.com/approve?requestId=123&accessToken=xyz`.\n\nThe combination `requestId=123` and `accessToken=xyz` is the one that you have to generate in advance, making sure that the `accessToken` cannot be deduced from the `requestId`. Any approval request with `requestId=123` and no `accessToken` or with a `accessToken` not equal to `xyz` should be rejected. Once this request gets through, any future request with the same id and access token should be rejected too."]]