Oauth authentication successfull, but API access response 401

Hi, I’m using free new frameio (just recently got downgraded from my trial) While I was still using frameio trial I had created an OAuth Web App in Adobe Developer Console. I use it to authenticate users for a script (which runs on an external VM, not on my machine) to be able to upload/remove to my test frameio workspace using frameio v4 api. Turns out I can do it (authenticate + publish/remove) without issues. A friend gets authenticated with Adobe Oauth correctly (gets access token, refresh token and id token) - but when the script proceeds to try to get a response from frameio v4 api, it returns with: 401, {‘errors’: [{‘title’: ‘Unauthorized’, ‘detail’: ‘Invalid or missing authorization token’}]}

I’ve added my friends email as a beta user to my Adobe Oauth Web App (its in development). Also I’ve added their email (and they’ve confirmed) to my frameio test workspace (when i check the workspace users using api endpoint, they’re there with me).

In my friends Adobe account when they go to Adobe Account → Account and security → Data and privacy settings → Connected apps , my adobe Oauth web app is there listed as having access.

The scopes for my Oauth web app are: offline_access, openid, additional_info.roles, profile

Am I missing anything for my friend to be able to upload to my test frameio workspace? Why do they get the ‘Invalid or missing authorization token’ but it works for me?

my friend jumpstarts this script without problems:

@frameIOv4PlaylistHandlerBlueprint.route('/frameio/startOauth_sendPlaylistToFrameIO/', methods=['GET', 'POST'])
def authorize_sendPlaylistToFrameIO():
    payload = request.form.to_dict()
    '''Passing payload from Sg on rclick to the next endpoint'''
    session['sgPayload'] = payload

    params = {
        'client_id': Config.ADOBE_OAUTH_WEB_APP_CLIENT_ID,
        'scope': Config.ADOBE_OAUTH_WEB_APP_SCOPES,
        'response_type': 'code',
        'redirect_uri': 'https://mydomain.org/frameio/callback_sendPlaylistToFrameIO'
    }
    return redirect(Config.ADOBE_OAUTH2_URL + urllib.parse.urlencode(params))

which in turn launches:

@frameIOv4PlaylistHandlerBlueprint.route('/frameio/callback_sendPlaylistToFrameIO')
def callback_sendPlaylistToFrameIO():
    # Retrive the authorization code from callback
    authorizationCode = request.args.get('code')

    params = {
        'grant_type': 'authorization_code',
        'client_id': Config.ADOBE_OAUTH_WEB_APP_CLIENT_ID,
        'client_secret': Config.ADOBE_OAUTH_WEB_APP_CLIENT_SECRET,
        'code': authorizationCode
    }
    response = requests.post(Config.ADOBE_OAUTH2_TOKEN_URL,
                             params=params,
                             headers={'content-type': 'application/x-www-form-urlencoded'})

    if response.status_code == 200:
        session['credentials'] = response.json()
        return redirect(f"https://mydomain.org/frameio/sendPlaylistToFrameIO")

and its only here that they encounter a problem:

accessToken = credentials.get('access_token')

(...)

self._headerApiV4 = self.HeaderApiV4(accessToken)

(...)

    def HeaderApiV4(self, accessToken):
        return {'Authorization': f'Bearer {accessToken}'}

(...)
# a test request at me endpoint, but i've tested a few and they all return the same result for him, while they all work for me
response = requests.get(
            "https://api.frame.io/v4/me",
            headers=self._headerApiV4
        )
        print(f"BASIC API ACCESS RESPONSE: {response.status_code} | {response.json()} | {response.text}")

Result:

BASIC API ACCESS RESPONSE: 401 | {'errors': [{'title': 'Unauthorized', 'detail': 'Invalid or missing authorization token'}]} | {"errors":[{"title":"Unauthorized","detail":"Invalid or missing authorization token"}]}

I’m facing the same isssue, even after using the Access code, it still returns 401 error.

1 Like

Hi @magma @AnshPoddar you both are likely running into the issue where your Frame.io account is not linked to an Adobe ID, hence the 401 error. Please reach out to our support team to ask them to initiate the Adobe ID linking process for you both.

I actually did reached out to them, the lady said my account is now linked to my adobe accoutn and now whenever I login into my frame.io account it redirects me to a Adobe SUSI screen to login.

and yes i’m using same email id on frame and adobe

Are you able to use Postman to successfully list your accounts with the API? If you are still encountering 401 errors when using postman, please send me a DM with the account ID that you are trying to connect to (Or send a share link, I can get the info from there too)