You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Airship Python Library supports multiple authentication methods through different client classes. Each client class inherits from :py:class:`BaseClient` and provides specific authentication functionality.
5
+
6
+
Base Client
7
+
===========
8
+
9
+
.. autoclass:: urbanairship.client.BaseClient
10
+
:members:
11
+
:exclude-members: _request, request
12
+
13
+
Basic Authentication
14
+
===================
15
+
16
+
The :py:class:`BasicAuthClient` is used for traditional key/secret authentication. This is the same as the deprecated `Airship` client class.
The :py:class:`BearerTokenClient` is used when you have an Airship-generated bearer token. This is useful when you want to manage token refresh yourself or when using tokens from other sources.
The :py:class:`OAuthClient` handles OAuth2 authentication using JWT assertions. It automatically manages token refresh and is recommended for production use.
The library uses `requests`_ for communication with the Airship API,
34
-
providing connection pooling and strict SSL checking. The ``Airship``
35
-
object is threadsafe, and can be instantiated once and reused in
36
-
multiple threads.
34
+
providing connection pooling and strict SSL checking. All client objects are
35
+
threadsafe, and can be instantiated once and reused in multiple threads.
37
36
38
-
Authentication Clients
39
-
----------------------
37
+
Authentication
38
+
-------------
40
39
41
-
The library supports authentication via 1 of 3 client classes:
40
+
The library supports three authentication methods:
42
41
43
-
* BasicAuthClient - This is the same as the deprecated `Airship` client class for using Key/Secret authentication.
44
-
* BearerTokenClient - This client takes a `token` argument with an Airship-generated bearer token in addition to the key and other configuration options.
45
-
* OAuthClient - This client requests an OAuth bearer token using the `client_id` and JWT assertion and automatically refreshes tokens as needed from the Airship OAuth2 provider. Please see the OAuth2 section of the Airship API documentation for more on this authentication method. If you prefer to handle token refresh yourself, the `access_token` returned from the Airship OAuth2 proivder can be used with the `BearerTokenClient`.
42
+
* Basic Authentication - Using app key and master secret
43
+
* Bearer Token Authentication - Using app key and Airship-generated bearer token
44
+
* OAuth2 Authentication - Using JWT assertions with automatic token refresh
46
45
47
-
More about these methods, including examples of instantiation can be found on the Airship docs site.
48
-
49
-
EU Base URL
50
-
-----------
51
-
52
-
When creating an instance of ``urbanairship.Airship``, an optional argument
53
-
may be added to specify use of Airship's EU data center. This is required for projects
54
-
based in our EU data center. If no location argument is passed, the US data center will be used.
0 commit comments