Aspera

Faspex 5 Python API Setup


Aspera Faspex 5 is an API-centric platform, supporting common administrative tasks as well as intricate integrations through its comprehensive API. For workflows that don’t involve user interaction, Faspex 5 incorporates JWT (JSON Web Token) for API authentication.

This guide provides a hands-on approach to implement this authentication in Python, complete with sample code for quick API testing.

Prerequisites:
Python 3 & pip
Faspex 5.0+
Download files: authenticate.py constants.py get_health_and_users.py

JWT Authentication Flow
Generate a JWT assertion.
Sign the JWT with your private key. This key should correspond to a public key added into Faspex.
Send the JWT to the Faspex auth component to get a bearer token.
Use this bearer token for making authenticated API requests to Faspex.

Setting Up OAuth Client:

  1. Generate an RSA keypair:
    ssh-keygen -t rsa -m PEM -f [key_location]
  2. Convert the public key to PEM (this output is entered in the GUI below):
    ssh-keygen -f [key_location] -e -m pem
  3. Register a new API client in Faspex. From the Admin app within Faspex, go to “Configurations” – “API clients” and select “Create new.”
    Choose JWT grant type, set token expiry, and assign permissions.
    Either enter the public key here as a global value for selected users to use, or turn ‘Global key’ off and enter the public key in your user
    profile within Faspex.
    Select “Create” and make note of the Client ID for next steps.

Python Script Setup:
Install pyjwt and pyopenssl modules:
pip install pyjwt pyopenssl
Download the three example files to a directory along side your RSA keypair: authenticate.py constants.py get_health_and_users.py

In constants.py , fill in your Faspex server details, API client ID, and your email.
Modify the key location if needed, or use the default (jwt.key and jwt.key.pub within the working directory)
Testing Your Setup:

  1. Test authentication: python3 authenticate.py . Use –debug for error details if there are any issues (check that the constants are correct and the keys are in the right format)
  1. Modify the script to test other endpoints relevant to your workflow. Refer to the Faspex API documentation for further information:
    IBM API Hub – Faspex 5 Endpoints
    IBM Aspera Faspex Ruby JWT example
Jason Warman

Recent Posts

Казино Пинко должностной веб-журнал, непраздничное гелиостат, приняться играть

Для каждого формата подготовлены предметные выборки, которые упрощают разыскание подходящих веселий. Зли всех неношеных заказчиков…

16 hours ago

Игорный дом Пинко должностной сайт, рабочее лучник, приняться бацать

ContentВознаграждение при регистрации в игорный дом - Пинко официальный сайтВербное во кабинет пользователя Пинко игорный…

16 hours ago

Pinco kumarhanesinin resmi web sitesi ve ayrıca Pinco kumarhanesinin mobil versiyonu, bam online

SahiplikPinco Türkiye: En iyi PinUp slotları ve performans sağlayıcılarıPinco Online Casino Slot Makinesi Davranış KurallarıPinco…

17 hours ago

Các trang web chơi game sòng bạc hàng đầu để kiếm lợi nhuận thực sự tại Hoa Kỳ năm 2024

Bài viếtTôi có muốn các quy tắc tiền thưởng để giúp bạn yêu cầu một…

2 days ago

Wolf Work on Free Enjoy in the Demo Mode & Opinion

BlogsBetter Online game to play which have a no-deposit IncentiveBonus symbolsThe brand new! Jackpot FinancingWolf…

3 days ago

Wish to Abreast of a star Position Opinion Greentube Trial Game

Posts❓ What is the Wish to On a good Jackpot RTP rates?Must i contain the…

3 days ago