Federated Authentication Provider Plugin in Sitecore Identity Server with Docker Container
I have managed to successfully implement using Okta to login Sitecore Content Authors. Whilst this is not the most difficult Identity Server implementation out there, I have learned a few things, and there are also a couple of gotcha’s that people need to watch out for, especially when working with Docker Containers.
The Sitecore version I am using is v10.0.0, however I believe this is applicable to versions up to, and maybe not limited to 10.2.0.
Firstly, massive shout out to Aaron Bickle who has provided the community with this useful guide on implementing Okta to Sitecore Identity Server. Please follow his blog series here to start https://www.xcentium.com/blog/2020/04/14/federated-auth-via-okta
However, small amendments must be made for Sitecore v10.x
Final Output Structure
The final output structure needs to be:
- The DLLs are at the root
- The
sitecore
folder contains the Plugin configuration - The
sitiecoreruntime
folder contains all the configuration patches, similar to other .Net Core roles in Sitecore
MSBuild Compiler Runtime
According to the documentation, the .Net Standard C# Project requires a SDK format using Sitecore.Framework.Runtime.Build. This SDK does not work in .NET 6. The project can only be compiled using Visual Studio 2019 Runtimes, and not Visual Studio 2022. If a developer PC has both Visual Studio 2019 and 2022 installed, this project cannot compile using command line tools. This has been confirmed by Sitecore Support when I logged a support ticket.
For Azure Pipelines, this means the project must be compiled using windows-2019
, where Visual Studio 2019 is installed in the agent.
To compile in the container, a specific version of Windows container is required.
For Sitecore, all the examples are pointing to using the Dotnet Framework 4.8 containers for any compilation activities. However, Microsoft introduced a breaking change which upgraded Visual Studio Build Tools to 2022. Use the full version tag mcr.microsoft.com/dotnet/framework/sdk:4.8-20211012
instead which uses Visual Studio 2019 Build Tools.
Docker Containers Developer Experience
There is supposed to be a Powershell script entry point available, so that any changes during plugin development is streamlined.
Praveen Manchana has provided a way to do this
Another approach, which I am using, is to just rebuild the Identity Server container each time if Praveen’s approach does not work. The application is super lightweight, so it is not a massive deal for me personally.
Conclusion
I hope my learnings above can provide something useful to the community.