# Introducing OAuth 2.0 Authentication in the Frame.io Python SDK

**URL:** <https://forum.frame.io/t/introducing-oauth-2-0-authentication-in-the-frame-io-python-sdk/3252>\
**Category:** General\
**Tags:** sdk, api, v4\
**Created:** [March 24, 2026, 9:48pm UTC](https://forum.frame.io/t/introducing-oauth-2-0-authentication-in-the-frame-io-python-sdk/3252 "2026-03-24T21:48:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![CharlieAnderson](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.frame.io/charlieanderson/32/491_2.png) [@CharlieAnderson](https://forum.frame.io/u/CharlieAnderson)\
**Post date:** [March 24, 2026, 9:48pm UTC](https://forum.frame.io/t/introducing-oauth-2-0-authentication-in-the-frame-io-python-sdk/3252/1 "2026-03-24T21:48:34Z")

</div>

#Feedback Introducing OAuth 2.0 Authentication in the [Frame.io](http://Frame.io) Python SDK

We’re excited to announce that the [Frame.io](http://Frame.io) Python SDK (`frameio`) now includes built-in OAuth 2.0 authentication. No more managing tokens manually or dealing with 401 errors anymore— the SDK handles the full lifecycle for you.

## What’s New

The new `frameio.auth` module supports three OAuth 2.0 flows:

| Flow | Best For |
| --- | --- |
| **Server-to-Server** | Backend services, scripts, automation — no user interaction needed |
| **Web App** | Server-side apps (Flask, Django, FastAPI) where users sign in |
| **SPA (PKCE)** | Browser apps, CLIs, or anything that can't store a client secret |

Every flow has both sync and async variants, so it works whether you’re building a simple script or an async web service.

## How to Try It

### 1. Install or upgrade the SDK

```bash

pip install frameio --upgrade

```

### 2. Get your credentials

Head to the [Adobe Developer Console](https://developer.adobe.com/console) and create a project with [Frame.io](http://Frame.io) API access. You’ll need:

- **Client ID** (all flows)

- **Client Secret** (Server-to-Server and Web App)

- **Redirect URI** (Web App and SPA — must be registered in your Adobe project)

### 3. Authenticate

**Server-to-Server** (simplest — great for scripts and backend services):

```python

from frameio import Frameio

from frameio.auth import ServerToServerAuth

auth = ServerToServerAuth(

client_id="YOUR_CLIENT_ID",

client_secret="YOUR_CLIENT_SECRET",

)

client = Frameio(token=auth.get_token)

# That's it. Tokens refresh automatically.

me = client.users.me()

print(f"Authenticated as {me.name}")

```

**Web App** (for apps where users sign in):

```python

import secrets

from frameio import Frameio

from frameio.auth import WebAppAuth

auth = WebAppAuth(

client_id="YOUR_CLIENT_ID",

client_secret="YOUR_CLIENT_SECRET",

redirect_uri="https://yourapp.com/callback",

)

# Step 1: Redirect user to Adobe sign-in

url = auth.get_authorization_url(state=secrets.token_urlsafe(32))

# Step 2: In your callback handler, exchange the code

auth.exchange_code(code=request.args["code"])

# Step 3: Use the client

client = Frameio(token=auth.get_token)

```

**SPA / PKCE** (for apps that can’t store a secret):

```python

import secrets

from frameio import Frameio

from frameio.auth import SPAAuth

auth = SPAAuth(

client_id="YOUR_CLIENT_ID",

redirect_uri="https://yourapp.com/callback",

)

result = auth.get_authorization_url(state=secrets.token_urlsafe(32))

# Redirect user to result.url, store result.code_verifier

# In your callback:

auth.exchange_code(code="CODE_FROM_CALLBACK", code_verifier=result.code_verifier)

client = Frameio(token=auth.get_token)

```

## Key Features

- **Automatic token refresh** — tokens are refreshed transparently before they expire

- **Token persistence** — `export_tokens()` and `import_tokens()` let you save and restore tokens across app restarts

- **Token revocation** — `auth.revoke()` invalidates tokens with Adobe IMS

- **Async support** — every flow has an async variant (`AsyncServerToServerAuth`, `AsyncWebAppAuth`, `AsyncSPAAuth`)

- **Thread-safe** — multiple threads can call `get_token()` concurrently; only one refresh happens at a time

## Error Handling

The module includes specific exceptions so you can handle failures precisely:

```python

from frameio.auth import AuthenticationError, TokenExpiredError

try:

client = Frameio(token=auth.get_token)

assets = client.files.list(project_id="...")

except TokenExpiredError:

# Refresh token expired — redirect user to sign in again

pass

except AuthenticationError as e:

print(f"Auth failed: {e.error_code} — {e.error_description}")

```

## Resources

- [Python Authentication Guide](https://next.developer.frame.io/platform/v4/docs/guides/authentication/python-sdk) — full walkthrough with Flask examples

- [SDK Reference](https://next.developer.frame.io/platform/docs/sdk-reference/python-sdk-reference) — API reference for all auth classes (to be updated very soon)

## Feedback

We’d love to hear how it works for you. If you run into issues or have feature requests reply to this post!

---

<div class="post-metadata">

**Author:** ![CharlieAnderson](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.frame.io/charlieanderson/32/491_2.png) [@CharlieAnderson](https://forum.frame.io/u/CharlieAnderson)\
**Post date:** [March 24, 2026, 10:34pm UTC](https://forum.frame.io/t/introducing-oauth-2-0-authentication-in-the-frame-io-python-sdk/3252/2 "2026-03-24T22:34:34Z")

</div>



---

<div class="post-metadata">

**Author:** ![piroP](https://avatars.discourse-cdn.com/v4/letter/p/f17d59/32.png) [@piroP](https://forum.frame.io/u/piroP)\
**Post date:** [March 25, 2026, 5:53pm UTC](https://forum.frame.io/t/introducing-oauth-2-0-authentication-in-the-frame-io-python-sdk/3252/3 "2026-03-25T17:53:17Z")

</div>

Hi  
I had a go but with not much luck.

a couple o questions:

- do i have to recreate all the: toke, client id, account id on [developer.adobe.com](http://developer.adobe.com) or [developer.frame.io](http://developer.frame.io)
- which API type do i choose in the project OAuth Web App,OAuth Single-Page App or OAuth Native App

thanks  
Andrea

---

<div class="post-metadata">

**Author:** ![CharlieAnderson](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.frame.io/charlieanderson/32/491_2.png) [@CharlieAnderson](https://forum.frame.io/u/CharlieAnderson)\
**Post date:** [March 25, 2026, 7:04pm UTC](https://forum.frame.io/t/introducing-oauth-2-0-authentication-in-the-frame-io-python-sdk/3252/4 "2026-03-25T19:04:36Z")

</div>

Our [getting started guide](https://next.developer.frame.io/platform/docs/getting-started) is the best place to learn how to get up and running.

tldr; you need to create a project in the developer console and add the [frame.io](http://frame.io) API to your project, and select your user auth depending on what you are looking to accomplish.

You can find more information about what credential types does what on our [Authorization doc](https://next.developer.frame.io/platform/docs/guides/authentication/overview#user-authentication).

 ![Screenshot 2026-03-25 at 3.04.23 PM](https://canada1.discourse-cdn.com/flex035/uploads/frame1/original/1X/c92a539fdaa0e7068c6569901f4b52a3b955b695.png)
