Erstellt ein Sitzungscookie für das angegebene Identity Platform-ID-Token. Das Sitzungscookie wird vom Client verwendet, um den Anmeldestatus des Nutzers beizubehalten.
HTTP-Anfrage
POST https://identitytoolkit.googleapis.com/v1/projects/{targetProjectId}/tenants/{tenantId}:createSessionCookie
Die Anzahl der Sekunden, bis das Sitzungs-Cookie abläuft. Geben Sie eine Dauer in Sekunden an, die zwischen fünf Minuten und vierzehn Tagen liegen muss.
Antworttext
Wenn der Vorgang erfolgreich abgeschlossen wurde, enthält der Antworttext eine Instanz von CreateSessionCookieResponse.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-03-04 (UTC)."],[[["\u003cp\u003eThis webpage details the process of creating a session cookie using the Identity Platform ID token, which is done through an HTTP POST request to a specified URL.\u003c/p\u003e\n"],["\u003cp\u003eThe request requires two path parameters: \u003ccode\u003etargetProjectId\u003c/code\u003e representing the project ID, and \u003ccode\u003etenantId\u003c/code\u003e representing the tenant ID that the account belongs to.\u003c/p\u003e\n"],["\u003cp\u003eThe request body must be in JSON format and contain both an \u003ccode\u003eidToken\u003c/code\u003e, which is a valid Identity Platform ID token, and a \u003ccode\u003evalidDuration\u003c/code\u003e, which is an integer value specifying the cookie's expiration time in seconds, that is between five minutes and fourteen days.\u003c/p\u003e\n"],["\u003cp\u003eSuccessful requests will receive a response body containing an instance of \u003ccode\u003eCreateSessionCookieResponse\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eTo perform the operation, the request must be authorized using one of two OAuth scopes: \u003ccode\u003ehttps://www.googleapis.com/auth/identitytoolkit\u003c/code\u003e or \u003ccode\u003ehttps://www.googleapis.com/auth/cloud-platform\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Method: projects.tenants.createSessionCookie\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nCreates a session cookie for the given Identity Platform ID token. The session cookie is used by the client to preserve the user's login state.\n\n### HTTP request\n\n`POST https://identitytoolkit.googleapis.com/v1/projects/{targetProjectId}/tenants/{tenantId}:createSessionCookie`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n### Request body\n\nThe request body contains data with the following structure:\n\n### Response body\n\nIf successful, the response body contains an instance of [CreateSessionCookieResponse](/identity-platform/docs/reference/rest/v1/CreateSessionCookieResponse).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/identitytoolkit`\n- `\n https://www.googleapis.com/auth/cloud-platform`\n\nFor more information, see the [Authentication Overview](/docs/authentication#authorization-gcp)."]]