Skip to main content
Ctrl+K
Caterva2 0.3.dev0 documentation - Home Caterva2 0.3.dev0 documentation - Home
  • Getting Started
  • Tutorials
  • API Reference
  • Utilities
  • Development
    • Release Notes
  • GitHub
  • ironArray Web Site
  • Getting Started
  • Tutorials
  • API Reference
  • Utilities
  • Development
  • Release Notes
  • GitHub
  • ironArray Web Site
  • caterva2.api_utils.get_auth_cookie

caterva2.api_utils.get_auth_cookie#

caterva2.api_utils.get_auth_cookie(urlbase, user_auth)#

Authenticate to a subscriber as a user and get an authorization cookie.

Authentication fields will usually be username and password.

Parameters:
  • urlbase¶ (str) – The base of URLs of the subscriber to query.

  • user_auth¶ (dict) – A mapping of fields and values used as data to be posted for authenticating the user.

Returns:

An authentication token that may be used as a cookie in further requests to the subscriber.

Return type:

str

Examples

>>> import caterva2 as cat2
>>> urlbase = 'https://cat2.cloud/demo'
>>> auth_cookie = cat2.get_auth_cookie(urlbase, dict(username='user@example.com', password='foo'))
>>> cat2.upload('root-example/ds-sc-attr.b2nd', '@personal/attr.b2nd', urlbase, auth_cookie)
PosixPath('@personal/attr.b2nd')
On this page
  • get_auth_cookie()

This Page

  • Show Source

© Copyright 2024, ironArray SLU.

Created using Sphinx 8.2.3.

Built with the PyData Sphinx Theme 0.16.1.