Skip to content

Conversation

@MariusWirtz
Copy link
Collaborator

Fixes #855

@macsir
Copy link
Contributor

macsir commented Feb 6, 2023

Hi, @MariusWirtz , I assume this new re_auth method is reusing the same session id?

@MariusWirtz
Copy link
Collaborator Author

I assume this new re_auth method is reusing the same session id?

I imagine you would only call the re_auth function when your session is already invalidated.
The below script has a new session_id after the re_auth.

from TM1py import TM1Service

tm1 = TM1Service(base_url="https://localhost:12354", user="admin", password="apple")
print(tm1.connection.session_id)

# imagine this logout happens naturally after a long wait time through HttpSessionTimeout on TM1 side
tm1.logout()

tm1.re_connect()

print(tm1.connection.session_id)

out:

fHA5dgLnIGAhRh-B3Nktdpl1IqA
BLWCG9y58JK2_XsVBkteLZp1IqA

@MariusWirtz MariusWirtz merged commit 9fb6e31 into master Feb 20, 2023
@MariusWirtz MariusWirtz deleted the feature/re-connect-on-session-timeout branch April 9, 2023 18:16
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 this pull request may close these issues.

Add boolean re_authenticate argument to TM1Service

3 participants