CreateAuthCookie

Updated at:
Copy as MD

Creates a new authentication cookie.

Request syntax

POST /2020-04-30/auth/cookies
Authorization: Authorization
Important 2020-04-30 is the version number of the edge OpenAPI. This value cannot be changed.

Request parameters

ParameterTypeRequiredDescription
AuthorizationStringYesSupports Basic authentication. The format is Basic base64(username:password).

For example: Basic Y2h5aW5n********NTY=.

Note
  • username is the username used to log on to the edge gateway console.
  • password is the password used to log on to the edge gateway console.

For more information, see Log on to the edge gateway console.

Response syntax

HTTP/1.1 StatusCode
Set-Cookie: Cookie
Content-Type: application/json

Response parameters

ParameterTypeDescription
StatusCodeNumberThe HTTP status code. A status code of 201 indicates success. Other status codes indicate failure. For more information about status codes, see Status codes.
CookieStringThe authentication cookie for subsequent API calls.

Complete example

curl -i -c token.cookie -u admin:admin1234 -k -X POST https://127.0.0.1:9999/2020-04-30/auth/cookies

HTTP/1.1 201 Created
Server: openresty/1.13.6.2
Date: Wed, 15 Apr 2020 11:03:05 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Set-Cookie: token=e82c2e9b7fe55a42143d89d1d635cd90a8ecef772a9520e3547028ad6a******; Max-Age=3600; Path=/