How Can I Determine "Current User" in SSO?

Our company uses Okta for SSO. I have a stand-alone (non-web) application. I am trying to find out if the “current user” running the app is already signed in to Okta. If so, I want to get the SAML assertion so I can eventually make an AWS call. (I’m not worried about taht part yet.)

I have the Okta SDK for .NET. Unfortunately, there seems to be no documentation that I can find for how to use the API (version 7.0.2). I only see references to GitHub repos. This is why I have no sample code posted.

Basically, I am just trying to validate if the current user is signed in; and, secondarily, where to find SDK documentation.

I’m not sure that using an SDK or API endpoint is the right fit for your application. The main way to check if a user has an existing Okta session (making a GET to /api/v1/sessions/me) is designed to be called in the browser where the user has an Okta session cookie set.

However, if you’re building a SAML app, you’ll wind up needing to redirect the user to Okta anyway so that they can start their application session (this would involve a browser redirect through Okta to log the user into the application). Once the user has logged in, the SAML response from Okta will contain the user information.

As far as the .NET Management SDK is concerned, you can find its docs here: okta-sdk-dotnet/ at master · okta/okta-sdk-dotnet · GitHub

1 Like