Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authentication with 'session_id' in the Credentials object raises 'ArgumentException' #19

Closed
nolan-sensorup opened this issue Apr 17, 2023 · 1 comment · Fixed by #20
Assignees

Comments

@nolan-sensorup
Copy link

When authenticating with a Credentials object that is given a session_id value and authenticating:

credentials = Credentials(username=..., database=..., server=..., session_id=...)
client = API.from_credentials(credentials)

The following error is returned:

{
    error: {
        code: -32000,
        data: {},
        errors: [
            {
                "message": "\"This method has been deprecated, and requires a custom code to be used. please use new methode 'ExtendSessionAsync' to extend your session.\"",
                "name": "'ArgumentException'",
            }
        ],
        message: "This method has been deprecated, and requires a custom code to be used. please use new methode 'ExtendSessionAsync' to extend your session.",
        name: "JSONRPCError",
    },
    id: -1,
    jsonrpc: "2.0",
    requestIndex: 0,
}

Details from GeoTab Community:
https://community.geotab.com/s/question/0D52J00009iEouYSAS/fail-to-authenticate-method-has-been-deprecated?language=en_US

mygeotab version: 0.8.8

@aaront aaront self-assigned this Apr 21, 2023
@aaront
Copy link
Contributor

aaront commented Apr 21, 2023

Hi @nolan-sensorup, I'll be taking a look at improvements, but as workaround when using the client after assigning it with API.from_credentials(credentials), you don't have to call client.authenticate().

If at this point you do want to extend your session, you should be able to call client.call("ExtendSession")... like so:

credentials = Credentials(username=..., database=..., server=..., session_id=...)
client = API.from_credentials(credentials)
client.call('ExtendSession', database=..., userName=..., sessionId=...)

# Make calls here
client.get('User', ....)

Please let me know if that worked for you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants