Duende IdentityServer is a very popular OAuth framework for developing SSO solutions. Whilst it provides everything you would need to implement the OAuth protocol, it is missing one key ingredient to complete your SSO solution. An Enterprise-grade management console to manage users and SSO client applications
Rock Solid Knowledge's All-in-one .NET template provides the management console (AdminUI) and a skeleton SSO solution ready for you to customize to your exact requirements. This means within less than 15 minutes of instantiating the template, you can have a solution up and running.
What is the All-In-One Template?
Rock Solid Knowledge has created a .NET template that sets up AdminUI and IdentityServer in the same .NET solution. This allows you to run IdentityServer and AdminUI directly from your IDE and get a feel for how everything hangs together. It's then only a few further steps to deploy the solution into production.
Before you get started, you will need:
- A database server, either Microsoft SQL Server, MySql or PostgreSQL
- An empty database
- The connection string to connect to the database
- An AdminUI license key
- Get a demo key from here
Install the Template
To install the .NET template into your local template store, run the following command from the command line
dotnet new install Rsk.AdminAllInOne
If that worked, executing
dotnet new --list RSK
Will produce the following output
RSK AdminUI All-In-One adminui+ids [C#] Web/RSK/IdentityServer
Creating your SSO solution
- Launch a command prompt
- Navigate to the folder that will contain the solution folder.
You are now ready to instantiate the template, but you will need to supply some parameters.
|-n <Solution Name>
|Your preferred name for your solution.
|-db <Db Provider>
Your database provider. Options are:
|-c <Connection String>
|Database connection string. This will vary based on the provider
|This is the URL where AdminUI will listen
|This is the URL where IdentityServer will listen
Instantiating the Template
Run the following command from the command prompt with your preferred values.
dotnet new adminui+ids
-c "Server=localhost;User Id=nacho;Password=Password123!;Database=IdentityExpressDb;"
Upon executing the above command, you will now have a folder called "MyAllInOneSolution". Inside this folder, there will be a MyAllInOneSolution.sln and two further folders
Open the .sln file in your favourite IDE.
Set the AdminUI License Key
From inside your IDE, navigate to the appsettings.json file in the AdminUI project and locate the property LicenseKey. Replace the value "**** YOUR ADMINUI LICENSE KEY ***" with your own.
Initialising the Database
You now have all the code necessary for your SSO solution, but before you can run the full solution, you will need to initialise the database. AdminUI comes with all the EF migrations necessary to create the databases. Each time you start AdminUI, it will check that the database has the correct schema and upgrade if required.
Run the AdminUI project from your IDE, If the database connection string has been configured correctly, AdminUI will run the database migrations
Started migration: Identity (1/8)
Completed migration: Identity
Started migration: Configuration (2/8)
Completed migration: Configuration
Started migration: Operational (3/8)
Completed migration: Operational
Started migration: ExtendedConfiguration (4/8)
Completed migration: ExtendedConfiguration
Started migration: Audit (5/8)
Completed migration: Audit
Started migration: Saml (6/8)
Completed migration: Saml
Started migration: WsFed (7/8)
Completed migration: WsFed
Started migration: DataProtection (8/8)
Completed migration: DataProtection
AdminUI will launch in your browser but fail to contact IdentityServer, as you haven't started it yet. AdminUI is an OAuth client of IdentityServer, so IdentityServer needs to be running to gain access to AdminUI.
From the IDE, run the IdentityServer project. Once launched, refresh the browser window running AdminUI. The Login button will now be enabled. Click on the Login button to redirect to IdentityServer to sign in.
The default administrator credentials are
- Username:[email protected]
- Password: Password123!
Once logged in, you will be prompted to change the default administrator account for AdminUI. Once completed and re-authenticated using the new credentials, you will be logged into AdminUI.
You now have an SSO solution ready to go; all you need now is to wire up an application to use SSO. A couple of useful resources below to get you started
If you have any questions regarding the template, please email [email protected].