SitecorePowerShell / Console

Sitecore PowerShell Extensions
https://doc.sitecorepowershell.com/
Other
114 stars 69 forks source link

Elevate Session State - no password input box #1180

Open svdoever opened 4 years ago

svdoever commented 4 years ago

Expected Behavior

Be able to login

Actual Behavior

Password input box not visible in Elevate Session State popup while Administrator:

image

And on clicking OK button the following error: Object reference not set to an instance of an object.

Stacktrace:

[NullReferenceException: Object reference not set to an instance of an object.]
   Spe.Client.Applications.PowerShellSessionElevation.OkClick() +164

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
   System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +269
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +146
   Sitecore.Shell.Framework.Commands.MethodCommandProcessor.Invoke(PipelineArgs args) +461
   Sitecore.Nexus.Pipelines.NexusPipelineApi.Resume(PipelineArgs args, Pipeline pipeline) +581
   Sitecore.Pipelines.Pipeline.Start(PipelineArgs args, Boolean atomic) +167
   Sitecore.Shell.Framework.Commands.MethodCommand.Execute(CommandContext context) +627
   Sitecore.Web.UI.Sheer.ClientPage.Dispatch(String command) +231
   Sitecore.Web.UI.Sheer.ClientPage.RaiseEvent() +124
   Sitecore.Web.UI.Sheer.ClientPage.OnPreRender(EventArgs e) +806
   System.Web.UI.Control.PreRenderRecursiveInternal() +200
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +7479

Steps to Reproduce the Problem

Happens when pressing play button in Sitecore ISE.

Version Sitecore: 9.3 Version: About box gives error:

image

Remote PowerShell commands work...

Other installation on same machine with HabitatHome on it works correctly.

michaellwest commented 4 years ago

Have you enabled the Identity Server configuration file included?

svdoever commented 4 years ago

Hi @michaellwest, thanks for responding so fast!

I found a file C:\inetpub\wwwroot\sergesc.dev.local\App_Config\Include\zzzserge.SPE.config.disabled, renamed it to zzzserge.SPE.config and did an IISReset, but still the same results. Is there something else I could try?

I compared the App_Config\Include folders of my HabitatHome environment where ISE and Elevate Session State are working with my sergesc environment where I don't get an input box.

I found the following differences:

App_Config\include\Spe.config

sergesc (not working):

<remoting enabled="true" requireSecureConnection="false">
          <authorization>
            <add Permission="Allow" IdentityType="User" Identity="sitecore\admin" />

HabitatHome (working):

<remoting enabled="false" requireSecureConnection="false">
          <authorization>

And on sergesc I have z.SPE.Sync.Enabler.Gulp.config enabled (so I can do remote scripting)

On the working HabitHome environment the file C:\inetpub\wwwroot\habitathomesc.dev.local\App_Config\Include\Spe\Spe.IdentityServer.config.disabled is disabled, but ISE is working!

I changed the whole include configuration that it is equal to the HabitatHome situation, but still not solved.

michaellwest commented 4 years ago

That's not a file provided by SPE. You should see one in the SPE folder having the name Identity Server. Spe.IdentityServer.config...

svdoever commented 4 years ago

I currently have this:

image

so I enabled the file Spe.IdentityServer.config, but still the same issue. Or did I misunderstood you?

michaellwest commented 4 years ago

Thank you for the screenshot. What does zzzserg.spe.config contain? The Identity Server config included with SPE has a simple change for the authentication to work.

Maybe showconfig.aspx would reveal more patches being applied that conflicts?

svdoever commented 4 years ago

The file `zzzserge.SPE.config``` contains:

<configuration xmlns:patch="https://www.sitecore.net/xmlconfig/">
  <sitecore>
    <powershell>
      <services>
        <remoting>
          <patch:attribute name="enabled">true</patch:attribute>
          <authorization>
            <add patch:before="*[@Identity='sitecore\PowerShell Extensions Remoting']" Permission="Allow" IdentityType="User" Identity="sitecore\admin" />
          </authorization>
        </remoting>
      </services>
    </powershell>
  </sitecore>
</configuration>

I did the same changes directly in Spe.config as well on my adventures to get PowerShell remoting working. I tried to disable the file but did not make a difference.

The output of https://sergesc.dev.local/sitecore/admin/showconfig.aspx is attached. I dind't see strange things - but that doesn't say anything:-) Output of showconfig.zip

github-actions[bot] commented 2 months ago

This issue is stale because it has been open for 365 days with no activity.