An example application demonstrating how SSO works with WorkOS and .NET.
Clone this repo and install dependencies:
git clone https://github.com/workos-inc/dotnet-sso-example.git && cd dotnet-sso-example && dotnet build
- Grab your API Key and Client ID from the WorkOS Dashboard.
Set these as environment variables in the Properties/launchSettings.json file,
labeled
WORKOS_API_KEY
andWORKOS_CLIENT_ID
, - Create an SSO Connection in the WorkOS Dashboard.
- Add
https://localhost:5001/Home/Callback
as a Redirect URI in the Configuration section of the Dashboard. - Update line 43 of
HomeController.cs
with the Connection domain (or Connection ID).
dotnet run
Head to https://localhost:5001
to authenticate!
For more information, see the WorkOS .NET SDK documentation.