How can you store some data during the authenticat...
# ask-ai
a
How can you store some data during the authentication in an object so that I can access that field in a stream?
u
You can store data during the authentication in an object by defining a new class that inherits from an existing authenticator class. This new class can include methods to store and retrieve data as needed. For example, in the case of the Webflow API, a new class called
WebflowTokenAuthenticator
is defined, which inherits from the
TokenAuthenticator
class. This class uses a mixin called
WebflowAuthMixin
to override the default
get_auth_header
method so that
accept-version
will be included in the header. The
WebflowTokenAuthenticator
class is instantiated as an object called
auth
as follows:
Copy code
python auth = WebflowTokenAuthenticator(token=api_key, accept_version=accept_version)
The
auth
object created by this call is passed to each stream, and ensures that
accept-version
will be included in each API request. This way, the
accept-version
data is stored in the
auth
object and can be accessed in each stream. You can follow a similar approach to store and access data in your own authenticator class. Just make sure to pass the object to each stream where you need to access the data. For more details, you can refer to the [Webflow API tutorial](https://airbyte.com/tutorials/extract-data-from-the-webflow-api#step-2) on the Airbyte website.