Use Sitefinity CMS as external identity provider
You can create an MVC 5 application that has integrated individual accounts and uses Sitefinity CMS Security Token Service (STS) as external provider for logging in the MVC 5 application.
IMPORTANT: Sitefinity CMS can act as external identity provider only via the implicit client authentication flow.
Register the MVC 5 application in Sitefinity CMS
You register the MVC 5 application as a client to the Sitefinity CMS STS with implicit flow of credentials.
To do this, perform the following:
- In Sitefinity CMS backend, navigate to Administration » Settings » Advanced.
- In the left pane, expand Authentication » SecurityTokenService » IdentityServer » Clients.
- Click Create new and fill out the form.
- In Client name, enter mvc
- In Client Id, enter mvc
- Select Enabled checkbox.
- In Client flow dropdown box, select Implicit.
- Select Allow access to all scopes checkbox.
- Save your changes.
The new client appears in the left pane, under Clients.
- Expand the newly created client and select RedirectUris.
- Click Create new.
- Enter the URL of your MVC 5 application and save your changes.
For example, enter http://YourMvcSite.com
- Expand the newly created client and select PostLogoutRedirectUris.
- Click Create new.
Enter the URL of your MVC 5 application and save your changes.
- Restart your Sitefinity CMS application.
Configure the MVC 5 application to use OpenIDConnect
You need to configure your MVC 5 application to use Sitefinity CMS STS as identity provider. Thus, when you browse the MVC 5 application and navigate to the login screen, you can see OpenIdConnect button. Clicking this button, you are redirected to Sitefinity CMS login screen and you can use your Sitefinity CMS credentials to login to the MVC 5 application.
For details how to complete the configuration, see the official IdentityServer3 documentation.
NOTE: Make sure when attaching the OpenIdConnectAuthentication middleware, the ClientId corresponds to the one you set when registering the MVC 5 application in Sitefinity CMS.
IMPORTANT: The Authority property needs to point to http://<YourSitefinitySite>/Sitefinity/Authenticate/OpenID