JB Leep
JB Leep

Reputation: 1

Loggin in to sharefile api with "corporate account"

I am developing a backup program for a client in Python. I got it running really great with my on 30-day test account at sharefile (Citrix). But now trying to authenticate into the corporate sharefile account, I can't do it. A support person told me I have to get an app-specific password in the two-factor section of security in my account. So I can do it, get the app-spec pw. Now I am using a ChatGPT supplied authentication method like this (non my real credentials).

   # Your credentials and endpoint
    client_id = 'zItaZW89Jpb8CVI2h1eeb9I7exxxxxxx'
    username = '[email protected]'
    app_specific_password = 'izlu xxxx mjdw xxxx'  # App-specific password 
    url = 'https://zzzzz.sharefile.com/oauth/token'   

    # Prepare the data for obtaining an access token
    data = {
        'grant_type': 'password',
        'client_id': client_id,
        'username': username,
        'password': app_specific_password.replace(' ', '')  # Remove spaces if necessary
                                                            # i tried both ways with/withou
    }

    # Send a request for authentication
    response = requests.post(url, data=data, auth=HTTPBasicAuth(client_id, app_specific_password.replace(' ', '')))

The error is: Failed to authenticate: b'{"error":"invalid_client","error_description":"client_id or client_secret is invalid"}'

I guess I am using the wrong credentials, obviously, but I don't think I am.

Any ideas?

I tried using regular id and secret, which works on my trial account, but the support person said "you may have to use the app specific way" and showed how to get the app spec password. Did not work. And you can't use an app-specific on a trial account for me to try.

Upvotes: 0

Views: 56

Answers (0)

Related Questions