Copied to clipboard

Flag this post as spam?

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


  • Johan Dahlström 33 posts 146 karma points
    Oct 30, 2018 @ 19:40
    Johan Dahlström
    0

    Multiple Umbraco instances - one "master" backoffice memebership provider

    I have a solution involving multiple Umbraco instances. I would like one of them to act as master regarding the backoffice accounts.

    As far as I understand, I need to create a custom UsersMembershipProvider, which first tries to authorize the user against the master instance. If a user successfully authorizes against the master instance, I would need to create or update a local user in the current instance, correct?

    When fetching the remote user, how am I supposed to extract data like "role" (admin, editor etc) and other settings like permissions?

    Finally, if I create a new user, how to sign it in programatically?

  • Alex Skrypnyk 6163 posts 24143 karma points MVP 8x admin c-trib
    Nov 12, 2018 @ 14:56
    Alex Skrypnyk
    0

    Hi Johan Dahlström

    Did you find a solution to this issue? Can you share with us?

    Alex

  • Johan Dahlström 33 posts 146 karma points
    Nov 12, 2018 @ 16:38
    Johan Dahlström
    0

    Hi Alex,

    I haven't implemented anything yet, but based on my findings I think I will do as follows:

    1. Set up an API endpoint to create/update backoffice users
    2. Hook in to UserService.SavedUser
    3. Whenever a backoffice user is updated, synchronize it with the other instances using their endpoints

    As far as I know, there has to be a physical backoffice user in order to log in - that's why the sync is necessary.

  • Alex Skrypnyk 6163 posts 24143 karma points MVP 8x admin c-trib
    Nov 12, 2018 @ 17:14
    Alex Skrypnyk
    0

    Hi Johan

    Sounds like a great plan.

    You can create users manually during login process, if the user doesn't exist in Umbraco but is valid from external API. So basically you don't have to have all users in Umbraco.

    What about user groups?

    Would you create the same user groups in Umbraco instances?

    Thanks,

    Alex

  • Johan Dahlström 33 posts 146 karma points
    Nov 12, 2018 @ 17:26
    Johan Dahlström
    0

    Thanks for your feedback.

    You can create users manually during login process, if the user doesn't exist in Umbraco but is valid from external API. So basically you don't have to have all users in Umbraco.

    When overriding CheckPasswordAsync, there doesn't seem to be a way to log in new users (see https://our.umbraco.com/forum/extending-umbraco-and-using-the-api/93655-umbraco-7-user-login-backoffice-programmatically for example). Perhaps it has been fixed?

    Regarding user groups I'm currently only using native ones, (admin and content manager) so it's simply a matter of assigning them accordingly.

Please Sign in or register to post replies

Write your reply to:

Draft