OAuth2 support #143
Replies: 3 comments 1 reply
-
Thanks for the interest and the idea! At first glance, I think it makes sense to add to the existing |
Beta Was this translation helpful? Give feedback.
-
I'm looking into this feature again, but I was wondering what the best way is to handle all the configuration parameters.
Should these all go in the Here is a small example of how it can be used with an external dependency: import stac_asset
from aiohttp_oauth2_client.client import OAuth2Client
from aiohttp_oauth2_client.grant.device_code import DeviceCodeGrant
...
async with DeviceCodeGrant(
token_url=TOKEN_URL,
device_authorization_url=DEVICE_AUTH_URL,
client_id=CLIENT_ID,
pkce=True,
) as grant, OAuth2Client(grant) as client:
download_client = stac_asset.HttpClient(session=client)
await stac_asset.download_item_collection(item_collection, "./Downloads", clients=[download_client]) |
Beta Was this translation helpful? Give feedback.
-
This has been implemented in #143 |
Beta Was this translation helpful? Give feedback.
-
Hi, we're interested in adding OAuth2/OIDC support to the HttpClient. Would you like this to be a configuration option on the existing
HttpClient
, or should we create a dedicated class for this? We can use theaiohttp-oauth2-session
package to add OAuth2 token integration to theaiohttp
ClientSession
object.It would also be nice if the configuration can be automatically loaded from the authentication STAC extension, but that would probably require some changes to the way clients are loaded:
stac-asset/src/stac_asset/client.py
Lines 189 to 221 in a201bba
What are your thoughts on this?
Beta Was this translation helpful? Give feedback.
All reactions