Seji64 / LAPS-WebUI

A nice and simple Web Interface for LAPS (Local Administrator Password Solution)
MIT License
29 stars 6 forks source link

Another exception (Sequence contains no matching element) #12

Closed RAB70 closed 1 year ago

RAB70 commented 1 year ago

Hi Seji, thanks for the new build. but I got another error. Depending on the settings: "LAPS": { "ForceVersion": "v2", "EncryptionDisabled": true }, I get different errors. When I set ForceVersion to null or "v2" I get the exception below. If I take v1 and set EncryptionDisabled to false, I get the message that I have no rights. The LAPS password is stored in the msLAPS-Password attribute. Do you have another idea? Thanks RAB 17:36:18 WRN] Unhandled exception rendering component: Sequence contains no matching element System.InvalidOperationException: Sequence contains no matching element at System.Linq.ThrowHelper.ThrowNoMatchException() at System.Linq.Enumerable.Single[TSource](IEnumerable1 source, Func2 predicate) at LAPS_WebUI.Pages.LAPS.<>cDisplayClass25_2.b22(RenderTreeBuilder builder8) at Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddContent(Int32 sequence, RenderFragment fragment) at MudBlazor.MudTabPanel.BuildRenderTree(RenderTreeBuilder builder) at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException) [17:36:18 ERR] Unhandled exception in circuit 'qe_JNt3Nq8dkrM0IsX8sFazZcvDfxIPBqIL8CKNks10'. System.InvalidOperationException: Sequence contains no matching element at System.Linq.ThrowHelper.ThrowNoMatchException() at System.Linq.Enumerable.Single[TSource](IEnumerable1 source, Func2 predicate) at LAPS_WebUI.Pages.LAPS.<>cDisplayClass25_2.b22(RenderTreeBuilder builder8) at Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddContent(Int32 sequence, RenderFragment fragment) at MudBlazor.MudTabPanel.BuildRenderTree(RenderTreeBuilder builder) at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException) [17:36:18 WRN] Unhandled exception rendering component: Cannot access a disposed object. System.ObjectDisposedException: Cannot access a disposed object. at Microsoft.AspNetCore.Components.RenderTree.ArrayBuilder1.GrowBuffer(Int32 desiredCapacity) at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException) at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue() [17:36:18 ERR] Unhandled exception in circuit 'qe_JNt3Nq8dkrM0IsX8sFazZcvDfxIPBqIL8CKNks10'. System.ObjectDisposedException: Cannot access a disposed object. at Microsoft.AspNetCore.Components.RenderTree.ArrayBuilder1.GrowBuffer(Int32 desiredCapacity) at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException) at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue() [17:36:18 INF] Executed endpoint '/_blazor'

Seji64 commented 1 year ago

Please note that the LAPS ForceVersion enum changed and therefore null is not longer allowed. Check the appsettings.json for the current values

RAB70 commented 1 year ago

Hi Seji, I re-read and looked at your sources. In my case, the LAPS password is in plain text in the msLAPS-password attribute in the format {"n":"LAPS admin","t":"1d9b97cb2bd3135","p":"LAPS password"} All other laps attributes are empty. So I try the settings like this: "LAPS": { "ForceVersion": "v2", // Allowed Values: All, v1, v2 | Default: All (v1 & v2) "EncryptionDisabled": true // Allowed Values: true, false | Default: false }, In the source code I read that the attribute is also read in the TRY block for v2 (variable ldapValue ). Unfortunately, I then get the error above. In all other combinations of the LAPS settings, I get the message that I have no rights or that LAPS is not used, which is also logical, all other LAPS attributes are empty. Do you have another tip? Thanks RAB

Seji64 commented 1 year ago

Tried your configuration with encryption disabled => works image

sees to be something with your enviroment - sorry.

RAB70 commented 1 year ago

Seji, you are the GOAT! Thank you. With your new release it works for me.