• Threads
  • Categories
  • Users
  • GitHub
  • Documentation
  • Discord
  • forum
  • group
  • search
  • chevron_right Threads
  • label Integrations

simple_sso user model error

Vanterkraft
Nov. 25, 2022
chat_bubble_outline 9
  • link
    Vanterkraft
    Members 5 posts
    Nov. 25, 2022, 12:18 p.m. Nov. 25, 2022, 12:18 p.m.
    link

    Hello, I wanted to connect misago to an existing project.
    I used a clean install, because my VDS does not support kvm and docker.

    I used the instructions from here - misago-project.org/t/101-single-sign-on-sso-implementation/948/post/4325/

    If I except urls.py if I don't touch misago, I get an error when going to the authorization page:
    (and add 'simple_sso.sso_client' in INSTALLED_APPS)

    Quoted message:

    AttributeError at /client/authenticate/
    Manager isn't available; 'auth.User' has been swapped for 'misago_users.User'

    But if I change settings.py :
    AUTH_USER_MODEL = "misago_users.User"
    To:
    AUTH_USER_MODEL = "auth.User"
    (And I added this, I don't know how critical):
    AUTHENTICATION_BACKENDS = [
    "misago.users.authbackends.MisagoBackend",
    "django.contrib.auth.models.User", #<-this
    ]

    Then I get the following error when restarting misago:

    Quoted message:

    choices=User.LIMIT_INVITES_TO_CHOICES,
    AttributeError: type object 'User' has no attribute 'LIMIT_INVITES_TO_CHOICES'

    UPD on misago side urls.py

    Quoted message:

    (Links and keys un settings.py)

    from simple_sso.sso_client.client import Client
    test_client = Client(settings.SSO_SERVER, settings.SSO_PUBLIC_KEY, settings.SSO_PRIVATE_KEY)

    urlpatterns = [
    ....
    path("django-admin/", admin.site.urls),
    path('client/', include(test_client.get_urls())),
    ]

    maybe I didn't follow these steps, because I didn't find where else SSO is enabled in missego

    Quoted message:

    Thus far, we have:

    pip installed and added 'simple_sso.sso_server' as an installed app in config.py
    enabled SSO via the admin panel on the misago server
    added entries for 'SSO_PRIVATE_KEY', 'SSO_PUBLIC_KEY' in config.py according to those provided by the misago admin panel

  • link
    rafalp
    Project Lead 1623 posts
    Nov. 25, 2022, 11:46 p.m. Nov. 25, 2022, 11:46 p.m.
    link

    Misago already comes with SSO client built in, have you tried using that?

  • link
    Vanterkraft
    Members 5 posts
    Nov. 26, 2022, 1:04 p.m. Nov. 26, 2022, 1:04 p.m.
    link
    @rafalp has written:

    Misago already comes with SSO client built in, have you tried using that?

    No, I couldn't find instructions on how to use it. But after joining the discord, I found in GIT a mention of "misago.sso" (which is not an application for INSTALLED_APPS)

  • link
    rafalp
    Project Lead 1623 posts
    Nov. 26, 2022, 8:50 p.m. Nov. 26, 2022, 8:50 p.m.
    link

    Have you tried enabling built-in SSO through the settings page in admin panel?

  • link
    Vanterkraft
    Members 5 posts
    Nov. 26, 2022, 9:07 p.m. Nov. 26, 2022, 9:07 p.m.
    link
    @rafalp has written:

    Have you tried enabling built-in SSO through the settings page in admin panel?

    I didn't see any SSO settings related to joining a django project(simple sso for example). Only Facebook,GitHub,Google,Twitter.

    Just in case, I will explain in more detail, I do not need registration on the misago side. The thread I referred to mentioned login/registration.

  • link
    rafalp
    Project Lead 1623 posts
    Nov. 26, 2022, 9:09 p.m. Nov. 26, 2022, 9:09 p.m.
    link

    You should see "Single Sign-On" settings in admin panel:

    Zrzut ekranu 2022-11-26 o 21.09.06.png

    Can you confirm?

    Zrzut ekranu 2022-11-26 o 21.09.06.png

    PNG, 202.3 KB, uploaded by rafalp on Nov. 26, 2022.

  • link
    Vanterkraft
    Members 5 posts
    Nov. 26, 2022, 9:22 p.m. Nov. 26, 2022, 9:22 p.m.
    link
    @rafalp has written:

    You should see "Single Sign-On" settings in admin panel:

    Zrzut ekranu 2022-11-26 o 21.09.06.png

    Can you confirm?

    Maybe git misago and git misago docker differ in components and I need to install the second one without docker?

    misago.jpg

    JPG, 296.1 KB, uploaded by Vanterkraft on Nov. 26, 2022.

  • link
    rafalp
    Project Lead 1623 posts
    Nov. 26, 2022, 9:23 p.m. Nov. 26, 2022, 9:23 p.m.
    link
    @Vanterkraft has written:

    Maybe git misago and git misago docker differ in components and I need to install the second one without docker?

    Git Misago contains development code for future releases. It's not guaranteed to work nor it's supported, sorry.

  • link
    Vanterkraft
    Members 5 posts
    Nov. 26, 2022, 9:40 p.m. Nov. 26, 2022, 9:40 p.m.
    link
    @rafalp has written:
    @Vanterkraft has written:

    Maybe git misago and git misago docker differ in components and I need to install the second one without docker?

    Git Misago contains development code for future releases. It's not guaranteed to work nor it's supported, sorry.

    I used the release of the main git 0.27(url below).Where should I download misago from to get SSO in settings?
    github.com/rafalp/Misago

  • link
    rafalp
    Project Lead 1623 posts
    Nov. 26, 2022, 9:43 p.m. Nov. 26, 2022, 9:43 p.m.
    link
    @Vanterkraft has written:

    I used the release of the main git 0.27(url below).Where should I download misago from to get SSO in settings?
    github.com/rafalp/Misago

    You've linked to master branch, 0.27 release is here: github.com/rafalp/Misago/tree/0.27.0

There are no more posts in this thread.

  • This site uses cookies to gather statistical data for use in traffic analysis. Header photo by Joanna Malinowska.
  • GitHub
  • Documentation
  • Discord
  • Terms of service
  • Privacy policy
powered by misago