I’m using /api/v1/sessions/me on the browser to get the active session of the user. here I get userID and SessionID. same I’m passing to my Python backend where I need to verify do any session is active for same user with UserID and SessionID received from the frontend.
I have tried /api/v1/sessions/{sessionID} but this API every time return the below error.
{
“errorCode”: “E0000005”,
“errorSummary”: “Invalid session”,
“errorLink”: “E0000005”,
“errorId”: “oae3OEdOw8GRROwdNRbxxIGtQ”,
“errorCauses”:
}
Is there a way to check does user logged in and the session is active for given session id.
How are you authorizing the call from your Python backend, are you including an Authorization header? That “Invalid session” error usually means that there aren’t sufficient admin permissions in the authorization for the call
hmmm… I don’t see anything wrong with your request, especially if a GET to /sessions/me works in the browser while user is logged in. The okta domain is definitely the same in both URLs?
@andrea
Here is what I’m trying to archive with OKTA.
I’m using Python 3.8 and FAST API. where I need OKTA SAML to be configured to protect some of my REST API endpoints.
Our Requirements.
Let user configure their SSO config with our system.
Based on their SSO config we will redirect the user to the OKTA login screen.
Users will provide their login details on the OKTA login screen and on successful login user will get redirected to call back URL configured on OKTA APP.
Digest OKTA response from login success redirection.
Let the user log in and access our rest API.
Here we expect users to be logged in the client’s browser as and the same should reflect in the Fast API back-end as well.
What we are expecting from OKTA.
Do we have any open source git project or library which can demonstrate how Okta SAML login flow can be integrated with Pyhton3 and FAST API.
Documentation which shows step by step instructions to set up everything.