havit / Bonusario

POC App for bonuses administration (merit money, rewards, ...)
6 stars 2 forks source link

net7 - Auth bez Emailu (InvalidOperationExcepotion ApplicationAuthenticationService.GetCurrentEmployeeAsync()) #33

Open hakenr opened 1 year ago

hakenr commented 1 year ago

občas

Unhandled exception rendering component: Status(StatusCode="Unknown", Detail="System.InvalidOperationException: Sequence contains no matching element
         at System.Linq.ThrowHelper.ThrowNoMatchException()
         at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate)
         at Havit.Bonusario.Web.Server.Infrastructure.Security.ApplicationAuthenticationService.GetCurrentUserEmail() in W:\BuildAgents\BuildAgent2\669\s\Web.Server\Infrastructure\Security\ApplicationAuthenticationService.cs:line 39
         at Havit.Bonusario.Web.Server.Infrastructure.Security.ApplicationAuthenticationService.GetCurrentEmployeeAsync(CancellationToken cancellationToken) in W:\BuildAgents\BuildAgent2\669\s\Web.Server\Infrastructure\Security\ApplicationAuthenticationService.cs:line 34
         at Havit.Bonusario.Facades.EntryFacade.GetMyGivenEntriesAsync(Dto`1 periodId, CancellationToken cancellationToken) in W:\BuildAgents\BuildAgent2\669\s\Facades\EntryFacade.cs:line 54
         at Grpc.Shared.Server.UnaryServerMethodInvoker`3.ResolvedInterceptorInvoker(TRequest resolvedRequest, ServerCallContext resolvedContext)
         at Grpc.Shared.Server.UnaryServerMethodInvoker`3.ResolvedInterceptorInvoker(TRequest resolvedRequest, ServerCallContext resolvedContext)
         at ProtoBuf.Grpc.Configuration.ServerExceptionsInterceptorBase.UnaryServerHandler[TRequest,TResponse](TRequest request, ServerCallContext context, UnaryServerMethod`2 continuation) in /_/src/protobuf-net.Grpc/Configuration/SimpleRpcExceptionsInterceptor.cs:line 75")
Grpc.Core.RpcException: Status(StatusCode="Unknown", Detail="System.InvalidOperationException: Sequence contains no matching element
   at System.Linq.ThrowHelper.ThrowNoMatchException()
   at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source, Func`2 predicate)
   at Havit.Bonusario.Web.Server.Infrastructure.Security.ApplicationAuthenticationService.GetCurrentUserEmail() in W:\BuildAgents\BuildAgent2\669\s\Web.Server\Infrastructure\Security\ApplicationAuthenticationService.cs:line 39
   at Havit.Bonusario.Web.Server.Infrastructure.Security.ApplicationAuthenticationService.GetCurrentEmployeeAsync(CancellationToken cancellationToken) in W:\BuildAgents\BuildAgent2\669\s\Web.Server\Infrastructure\Security\ApplicationAuthenticationService.cs:line 34
   at Havit.Bonusario.Facades.EntryFacade.GetMyGivenEntriesAsync(Dto`1 periodId, CancellationToken cancellationToken) in W:\BuildAgents\BuildAgent2\669\s\Facades\EntryFacade.cs:line 54
   at Grpc.Shared.Server.UnaryServerMethodInvoker`3.ResolvedInterceptorInvoker(TRequest resolvedRequest, ServerCallContext resolvedContext)
   at Grpc.Shared.Server.UnaryServerMethodInvoker`3.ResolvedInterceptorInvoker(TRequest resolvedRequest, ServerCallContext resolvedContext)
   at ProtoBuf.Grpc.Configuration.ServerExceptionsInterceptorBase.UnaryServerHandler[TRequest,TResponse](TRequest request, ServerCallContext context, UnaryServerMethod`2 continuation) in /_/src/protobuf-net.Grpc/Configuration/SimpleRpcExceptionsInterceptor.cs:line 75")
   at Havit.Blazor.Grpc.Client.WebAssembly.AuthorizationGrpcClientInterceptor.<HandleAsyncUnaryResponse>d__1`1[[System.Collections.Generic.List`1[[Havit.Bonusario.Contracts.EntryDto, Havit.Bonusario.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext()
   at Havit.Blazor.Grpc.Client.Cancellation.CancellationWorkaroundGrpcClientInterceptor.<HandleResponseAsync>d__1`1[[System.Collections.Generic.List`1[[Havit.Bonusario.Contracts.EntryDto, Havit.Bonusario.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext()
   at Havit.Blazor.Grpc.Client.ServerExceptions.ServerExceptionsGrpcClientInterceptor.<HandleResponseAsync>d__5`1[[System.Collections.Generic.List`1[[Havit.Bonusario.Contracts.EntryDto, Havit.Bonusario.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext()
   at Havit.Blazor.Grpc.Client.ServerExceptions.ServerExceptionsGrpcClientInterceptor.<HandleResponseAsync>d__5`1[[System.Collections.Generic.List`1[[Havit.Bonusario.Contracts.EntryDto, Havit.Bonusario.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext()
   at ProtoBuf.Grpc.Internal.Reshape.<UnaryTaskAsyncImpl>d__16`2[[Havit.Bonusario.Contracts.Dto`1[[System.Int32, System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], Havit.Bonusario.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null],[System.Collections.Generic.List`1[[Havit.Bonusario.Contracts.EntryDto, Havit.Bonusario.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], System.Private.CoreLib, Version=7.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext()
   at Havit.Bonusario.Web.Client.Components.MyEntriesFeed.LoadData()
   at Havit.Bonusario.Web.Client.Components.MyEntriesFeed.OnParametersSetAsync()
   at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
   at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task , ComponentState )
hakenr commented 1 year ago

Problém je, že jsem se omylem přihlásil na Microsoft Account, který je guest accountem do AAD. Trochu se to tam popralo.