Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ruby Con 7 posts 98 karma points
    Feb 04, 2022 @ 00:16
    Ruby Con
    0

    Umbraco 9 with Identity Server 4

    In Umbraco 8 we used UseOpenIdConnectAuthentication and Owin to set up authentication to Identity Server 4. When doing that, after a successful login, we could always get the current logged-in user through User.Identity from anywhere, whether it was a controller or in the cshtml.

    In Umbraco 9 we're setting it up in startup.cs using AddOpenIdConnect under AddAuthentication with the same parameters as in Umbraco 8. Logging in works correctly, but the User.Identity no longer works from everywhere. For example, where in Umbraco 8 we could check User.Identity.IsAuthenticated in the cshtml and it was true, now it's false (even though the user was signed in successfully).

    If accessed under a method with an [Authorize] filter it works correctly.

    We created a standard Asp Net 5 web app to test the behavior and it works as expected, until

    services.AddUmbraco(_webHostEnvironment, Configuration)
    .AddBackOffice()
    .Build();
    

    is added. With that User.Identity.IsAuthenticated is always false after login, even where it shows as true without the AddUmbraco call.

    Anyone know what we're doing wrong?

  • Rolle 5 posts 96 karma points
    May 04, 2022 @ 15:27
    Rolle
    0

    Hi Ruby,

    I have the same problem.

    Did you find a solution to this?

Please Sign in or register to post replies

Write your reply to:

Draft