Achieving a single sign-on by creating a virtual user with custom roles and rights

Sometimes, we may be in a situation where we need to authenticate users against an external security system before providing them access to secured pages or media items of the Sitecore website; this can be achieved by creating virtual users in Sitecore.

In some cases, virtual users are easier and simpler to implement than authentication providers. In this recipe, we will create a virtual user for an authenticated user of an external system, apply some predefined roles and permissions, and log in that user to access website resources.

Getting ready

This recipe assumes that a previewer user is already authenticated in any external application, and we will log in this ...

Get Sitecore Cookbook for Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.