Authentication

Authentication#

The STAC API allows users to browse the catalog without authentication, but to access fusion data assets you will need to authenticate. The STAC API and associated tools support Basic Auth (username and password) and Bearer Tokens. You should have received an email from support@hydrosat.com that contained a username (your email address) and temporary password. To reset your password, navigate to:

https://fusion.hydrosat.com

You should see a login form that looks like this:

Hydrosat login

Once you have reset your password, you will be able to log in with your new password to access the Fusion Hub.

We encourage the use of Basic Authentication with your username and password, preferably stored in a separate file and accessed via code, to access the STAC API. Here are some examples with the Python PySTAC-Client and Requests modules:

PySTAC-Client

import pystac
from pystac_client import Client
import base64
userpass = 'username:password'
b64 = base64.b64encode(userpass.encode()).decode()
headers = {'Authorization':'Basic ' + b64}
catalog = Client.open('https://fusion-stac.hydrosat.com/', headers)

Python Requests

import requests
r = requests.get('https://fusion-stac.hydrosat.com/collections', auth=('username', 'password'))

If you do wish to use the token directly in the header of your API or pystac-client requests, add it to the headers of the request. Examples are below.

PySTAC-Client

import pystac
from pystac_client import Client
headers = {'Authorization':'Bearer ' + 'your-access-token'}
catalog = Client.open('https://fusion-stac.hydrosat.com/', headers)

Python Requests

import requests
headers = {'Authorization':'Bearer ' + 'your-access-token'}
r = requests.get('https://fusion-stac.hydrosat.com/collections', headers=headers)