Copied to clipboard

Flag this post as spam?

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


  • Claus Jessing 7 posts 87 karma points
    Aug 27, 2019 @ 06:44
    Claus Jessing
    0

    Hi all. My first post... bare with me...

    I'd like to replace the user login (NOT the member login) in my Umbraco v8 installation but I haven't been able to find anything other than how to create custom MEMBER login pages.

    I don't just want to change the layout, but I want to use an entirely different identity provider.

    I have managed to create a login page that takes me to this other IdP and returns to Umbraco when login has been completed. But I have only been able to create a member login - not a user login.

    Can anyone direct me to a bit of information on how to do that? I do have a principal identity when returning from my IdP.

    Any help would be much appreciated :-)

    Edit: When I get to the point where I'd hoped to be logged in, instead I'm met with the standard Umbraco login page. I DO have an authCookie with the name I expect and a value like

    34C65CFA704B23F5738AFCC9677F55E3638F0555...
    

    Then if I login using the username/pwd for the user already authenticated through my IdP the content of the cookie changes to something like

    Ttc4EhEfR-1VST4NS5sPareXp3CKl_BQ...
    

    So obviously I haven't gotten the authCookie created correct.

    I'm hooking into the response from my IdP using an action that implements IAction so I dont have access to any context (Application or Umbraco) at the time I (try to) set the authCookie.

  • David Brendel 753 posts 2820 karma points c-trib
    Aug 27, 2019 @ 13:17
    David Brendel
    0

    Hi Claus,

    currently also playing with integrating IdentityServer and Umbraco. There are nuget packages that help by integrating.

    Search for Umbraco.Identity.

    Also there are some blog posts in the topic which can be adapted to v8

    Regards David

  • Claus Jessing 7 posts 87 karma points
    Aug 28, 2019 @ 04:32
    Claus Jessing
    0

    Thanks David

    I have already been looking into Shazwazzas Umbraco.Identity but that only adresses MEMBER login. Not backoffice user login which is what I'm after.

    Thanks for taking the time to reply :-)

  • Marc Goodson 1024 posts 6755 karma points MVP 4x c-trib
    Aug 28, 2019 @ 08:09
    Marc Goodson
    0

    Hi Claus

    Shannon also has a project that shows how to extend backoffice Users called UmbracoIdentityExtensions:

    https://github.com/umbraco/UmbracoIdentityExtensions

    It's been updated for V8.

    If it's not exactly what you need, it might provide some inspiration.

    regards

    Marc

  • David Brendel 753 posts 2820 karma points c-trib
    Aug 28, 2019 @ 06:39
    David Brendel
    0

    Hi Claus,

    so my starting point for integration was this article: https://yuriburger.net/2017/04/26/login-to-umbraco-backoffice-using-identityserver4/.

    Not sure which identity provider you want to use but I think it can give you some hints.

    For my bad I pointed you to the wrong package out of memory. The important ones are UmbracoCms.IdentityExtensions and then depending on what ID you want to use:

    • For Google auth: Install-Package UmbracoCms.IdentityExtensions.Google
    • For Facebook auth: Install-Package UmbracoCms.IdentityExtensions.Facebook
    • For Microsoft auth: Install-Package UmbracoCms.IdentityExtensions.Microsoft
    • For Azure ActiveDirectory auth: Install-Package UmbracoCms.IdentityExtensions.AzureActiveDirectory

    These are kind of pre-build starting points/integrations.

    If you want to use IdentityServer you need Microsoft.Owin.Security.OpenIdConnect to setup the OpenId connection instead of one of the above ones.

    Regards David

  • Claus Jessing 7 posts 87 karma points
    Aug 28, 2019 @ 06:49
    Claus Jessing
    0

    Thanks for getting back to me David :-)

    I have managed to get it working somewhat by implementing this logic in a custom SurfaceController:

    var identityName = HttpContext.User.Identity.Name; //Email
    var us = Services.UserService;
    var user = us.GetByEmail(identityName);
    UmbracoContext.Security.PerformLogin(user.Id);
    

    It's not exactly what I want but for a POC it works. Now I'm trying to figure out how to redirect users to /login when they try to access /umbraco and are not logged in. Here's another post I just made: https://our.umbraco.com/forum/extending-umbraco-and-using-the-api//98780-can-i-redirect-to-custom-user-login-if-user-is-not-logged-in-as-backoffice-user

    I'll have a look at your links :-)

Please Sign in or register to post replies

Write your reply to:

Draft