For the complete documentation index, see llms.txt. This page is also available as Markdown.

Login

Oauth:Login

post

Authenticates the user and returns an access token.

This endpoint supports two grant types:

  • standard OAuth2 password grant type - only supported for the admin user and only available if the admin account is enabled
  • standard OAuth2 device authorization grant type
  • ZenML API key and codespace token grant types

Args: request: The request object. response: The response object. auth_form_data: The authentication form data. user_manager: The user manager. workspace_manager: The workspace manager. codespace_manager: The codespace manager.

Returns: An admin access token.

Raises: ValueError: If the grant type is invalid.

Body
grant_typestring · nullableOptional
usernamestring · nullableOptional
passwordstring · nullableOptional
client_idstring · nullableOptional
client_secretstring · nullableOptional
device_codestring · nullableOptional
audiencestring · nullableOptional
Responses
200

Successful Response

application/json

OAuth 2.0 login response.

access_tokenstringRequired
expires_inintegerRequired
token_typestringOptionalDefault: bearer
device_idstring · nullableOptional
post/auth/login
POST /auth/login HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 138

"grant_type='text'&username='text'&password='text'&client_id='text'&client_secret='text'&device_code='text'&audience='text'"
{
  "access_token": "text",
  "expires_in": 1,
  "token_type": "bearer",
  "device_id": "text",
  "device_metadata": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  }
}
ZenML Scarf

Last updated

Was this helpful?