How do I add custom headers to the Identity server? I am using sxp/sitecore-id6:10.2.0-ltsc2019
image for the identity server. The Invoke-XdtTransform.ps1
we use on CM does not work as the id image does not have PowerShell. Is there any way I can add a transform to the web.config
file on the identity service?
-
Did you check this ? sitecore.stackexchange.com/questions/32091/…– Vikrant PunwatkarCommented Oct 26, 2023 at 6:20
-
@VikrantPunwatkar, I need to add transforms to the web.config file in the id container. I don't think I can add that in the project.– Vinay JadavCommented Nov 6, 2023 at 11:05
-
You may not need to include that to project, but can keep it in source control. And you need to trigger that logic to transform web config to desired values. Entrypoint in Docker file of Identity server can be used to do so and place modified web config in container.– Vikrant PunwatkarCommented Nov 15, 2023 at 6:31
Add a comment
|
1 Answer
Create a file named CustomIdentityServerTransform.xml with your header changes.
Copy this file into the Identity Server image:
FROM sxp/sitecore-id6:10.2.0-ltsc2019
COPY CustomIdentityServerTransform.xml C:/inetpub/wwwroot/identityserver
Apply the transform during the image build:
WORKDIR C:/inetpub/wwwroot/identityserver
RUN .\TransformWebConfig.ps1 -ConfigPath 'C:\inetpub\wwwroot\identityserver\web.config' -TransformFile 'C:\inetpub\wwwroot\identityserver\CustomIdentityServerTransform.xml' -OutputPath 'C:\inetpub\wwwroot\identityserver\web.config'`
Build the Docker image:
docker build -t your-custom-identity-server-image:tag .
Run the container:
docker run -d -p 44001:80 your-custom-identity-server-image:tag
-
I could not find the TransformWebConfig.ps1 file on the id service image, And I don't think PS scripts can be run on the id service. Commented Aug 22 at 11:42