Skip to main content

AuthN | Python SDK | Session Endpoints

Session Endpoints

Invalidate Session

authn.session.invalidate(session_id)

Invalidate a session by session ID.

required parameters

str

An ID for a session

Response Object

A PangeaResponse with an empty object in the response.result field.

authn.session.invalidate(
    session_id="pmt_zppkzrjguxyblaia6itbiesejn7jejnr",
)

List session (service token)

authn.session.list(filter, last, order, order_by, size)

List sessions.

optional parameters

dict
str

Reflected value from a previous response to obtain the next page of results.

m.ItemOrder

Order results asc(ending) or desc(ending).

m.SessionListOrderBy

Which field to order results by.

int

Maximum results to include in the response. Minimum: 1.

Response Object

A PangeaResponse with a list of sessions in the response.result field. Available response fields can be found in our API Documentation.

response = authn.session.list()

Log out (service token)

authn.session.logout(user_id)

Invalidate all sessions belonging to a user.

required parameters

str

The id of a user.

Response Object

A PangeaResponse with an empty object in the response.result field.

authn.session.logout(
    user_id="pui_xpkhwpnz2cmegsws737xbsqnmnuwtvm5",
)

Invalidate Session | Client

authn.client.session.invalidate(token, session_id)

Invalidate a session by session ID using a client token.

required parameters

str

A user token value

str

An ID for a session

Response Object

A PangeaResponse with an empty object in the response.result field.

authn.client.session.invalidate(
    token="ptu_wuk7tvtpswyjtlsx52b7yyi2l7zotv4a",
    session_id="pmt_zppkzrjguxyblaia6itbiesejn7jejnr",
)

List sessions (client token)

authn.client.session.list(token, filter, last, order, order_by, size)

List sessions using a client token.

required parameters

str

A user token value

optional parameters

dict
str

Reflected value from a previous response to obtain the next page of results.

m.ItemOrder

Order results asc(ending) or desc(ending).

m.SessionListOrderBy

Which field to order results by.

int

Maximum results to include in the response. Minimum: 1.

Response Object

A PangeaResponse with a list of sessions in the response.result field. Available response fields can be found in our API Documentation.

response = authn.client.session.list(
    token="ptu_wuk7tvtpswyjtlsx52b7yyi2l7zotv4a",
)

Log out (client token)

authn.client.session.logout(token)

Log out the current user's session.

required parameters

str

A user token value

Response Object

A PangeaResponse with an empty object in the response.result field.

authn.client.session.logout(
    token="ptu_wuk7tvtpswyjtlsx52b7yyi2l7zotv4a",
)

Refresh a Session

authn.client.session.refresh(refresh_token, user_token)

Refresh a session token.

required parameters

str

A refresh token value

optional parameters

str

A user token value

Response Object

A PangeaResponse with credentials for a login session in the response.result field. Available response fields can be found in our API Documentation.

response = authn.client.session.refresh(
    refresh_token="ptr_xpkhwpnz2cmegsws737xbsqnmnuwtbm5",
    user_token="ptu_wuk7tvtpswyjtlsx52b7yyi2l7zotv4a",
)