angus
(Angus McLeod)
11월 8, 2021, 6:10오전
22
새로운 접근 방식(지난 시도에서 @david님이 요청하신 변경 사항 을 반영)으로 업데이트된 초안 PR을 만들었습니다. PR 댓글에서 언급했듯이, 이번 주 안에 마무리할 예정입니다.
main ← angusmcleod:group_membership_via_authentication
merged 12:30PM - 09 Dec 21 UTC
Update on #12446.
@davidtaylorhq A draft for an update on the associated grou… p membership work. It's been rebased, brought in line with the latest changes and updated in the ways explained below. Let me know if you're onboard with the approach so far. I'll finish it off next weekend.
### Authentication and group retrieval
I've removed the secondary auth stuff, added a google-hd-specific boolean setting, and moved the group retrieval into a new google oauth2 omniauth strategy. I've made a new folder and added a spec for the strategy (something new in the codebase) as I thought it deserved a spec (which is also included). If we add in secondary auth to this strategy that too will need a spec. Some of the existing discourse omniauth strategies, e.g. Discord, may benefit from being seperated out and tested too.
### Group Provision and UI
As suggested, I've added a ``provides_groups?`` to the ``Auth::Authenticator``. Using this approach led to a new groups guardian method to use at the various group CRUD points. Speaking of which, I've added in support for group_associated_group creation in group creation (i.e. ``/g/custom/new``). Supporting it in both ``new`` and ``manage`` (update) also led to adding a new site attribute ``can_associate_groups``. I attempted to make this more group-route specific, however this leads to various clumsy workarounds to determine whether an admin can associate groups in ``/g/custom/new``. The site attribute approach proved the simplest and most performant (i.e. fewer ajax calls).
### Data model
I've made one change to the data model so far, namely to use ``after_commit`` hooks rather than ``after_create``/``after_destroy`` as using those hooks leads to duplicate record creation in ``Admin::GroupsController`` ``create``. I've yet to deal with the edge case you pointed out, i.e. multiple UserAssociatedGroups which link to the same group.
mattdm
(Matthew Miller)
11월 8, 2021, 2:57오후
23
무의미한 기대를 하지 않기 위해 확인하는 건데, 여기에는 "google"이라고 되어 있네요… Google이 아닌 다른 OAuth2 SSO에서도 작동할까요?
angus
(Angus McLeod)
11월 8, 2021, 3:01오후
24
이것은 범용 시스템이지만, 처음 지원되는 사용 사례는 Google Workspace의 그룹이 될 것입니다. 시스템이 구축되면 추가 프로바이더에 대한 지원을 추가하는 것은 그리 어렵지 않을 것입니다.
angus
(Angus McLeod)
11월 22, 2021, 6:06오전
25
이 PR이 주말 동안 초안에서 게시 상태로 변경되었음을 참고하세요(즉, 다시 검토가 가능합니다).
main ← angusmcleod:group_membership_via_authentication
merged 12:30PM - 09 Dec 21 UTC
Update on #12446.
@davidtaylorhq A draft for an update on the associated grou… p membership work. It's been rebased, brought in line with the latest changes and updated in the ways explained below. Let me know if you're onboard with the approach so far. I'll finish it off next weekend.
### Authentication and group retrieval
I've removed the secondary auth stuff, added a google-hd-specific boolean setting, and moved the group retrieval into a new google oauth2 omniauth strategy. I've made a new folder and added a spec for the strategy (something new in the codebase) as I thought it deserved a spec (which is also included). If we add in secondary auth to this strategy that too will need a spec. Some of the existing discourse omniauth strategies, e.g. Discord, may benefit from being seperated out and tested too.
### Group Provision and UI
As suggested, I've added a ``provides_groups?`` to the ``Auth::Authenticator``. Using this approach led to a new groups guardian method to use at the various group CRUD points. Speaking of which, I've added in support for group_associated_group creation in group creation (i.e. ``/g/custom/new``). Supporting it in both ``new`` and ``manage`` (update) also led to adding a new site attribute ``can_associate_groups``. I attempted to make this more group-route specific, however this leads to various clumsy workarounds to determine whether an admin can associate groups in ``/g/custom/new``. The site attribute approach proved the simplest and most performant (i.e. fewer ajax calls).
### Data model
I've made one change to the data model so far, namely to use ``after_commit`` hooks rather than ``after_create``/``after_destroy`` as using those hooks leads to duplicate record creation in ``Admin::GroupsController`` ``create``. I've yet to deal with the edge case you pointed out, i.e. multiple UserAssociatedGroups which link to the same group.
david
(David Taylor)
12월 9, 2021, 12:32오후
26
방금 이 PR을 병합했습니다. @angus 님, 여기에서 해주신 모든 작업에 진심으로 감사드립니다! 앞으로 이 기능이 어떻게 활용되고 확장될지 기대됩니다!
일단 사이트 설정에 “실험적” 라벨을 붙여 두었습니다. 시간이 좀 걸리더라도 충분히 테스트해 보고 모든 것이 원활하게 작동하는지 확인하고 싶기 때문입니다. 확신이 서고 몇 가지 인증 제공자에 대한 지원도 추가되면, 해당 기능에 대해 #feature:announcements 토픽을 꼭 만들겠습니다.
angus
(Angus McLeod)
12월 9, 2021, 1:44오후
27
멋지네요!
대卫 씨, 정말 감사드립니다. 당신의 지원이 없었다면 불가능했을 것입니다. 추가 제공자 추가를 도와드릴 수 있어서 기쁩니다.
mattdm
(Matthew Miller)
12월 9, 2021, 2:18오후
28
좋아요! 여러분 모두 감사합니다. oauth2와 호환되도록 작동하기 시작하면 Fedora에서 이를 광범위하게 사용할 계획입니다.
구글이 아닌 다른 OAuth2/OpenID 로그인 옵션이 지원되길 기대하고 있습니다… 해당 옵션이 언제, 어떻게 제공될 예정인지 업데이트가 있나요?
david
(David Taylor)
3월 11, 2022, 11:49오전
30
구체적인 타임라인은 없지만, 패치를 제출하고 싶으시다면 #pr-welcome입니다 .
저도 이에 대해 기대하고 있습니다! 우리의 사용 사례는 인증 시 Keycloak에서 그룹 멤버십을 가져오는 것입니다.
현재 저는 Discourse를 셀프호스팅으로 운영하고 있으며, 인증을 위해 Authentik를 ID 제공자로 사용하고 있습니다. 제가 달성하고자 하는 목표는 로그인 시 Authentik의 사용자 그룹을 Discourse의 특정 그룹과 자동으로 동기화하는 것입니다.
다만, Discourse의 로컬 등록 과정을 통해 가입한 로컬 사용자는 이러한 특정 그룹에 할당되지 않고, 대신 일반적인 신뢰 수준(Trust Level) 진행 단계를 따르도록 보장하고 싶습니다.
bsoares
(Ben Soares)
9월 10, 2025, 4:42오후
33
안녕하세요!
저희는 Atlassian Crowd(Discourse에서 더 이상 지원되지 않음)에서 인증을 OpenID Connect(Keycloak를 통해)로 이전했습니다. 그리고 몇 년 전 discourse-openid-connect 플러그인에 기여했던 Crowd 그룹 매핑 코드를 사용하려고 합니다.
현재 OpenID Connect 그룹과 Discourse 그룹 간의 맵을 구성할 수 있도록 하는 작동하는 코드 변경 사항을 가지고 있으며, 이를 PR FEATURE: Openid connect group maps - Pull Request #34763 - discourse/discourse - GitHub 에 올려두었습니다.
이 PR이 병합되도록 검토해 주시면 감사하겠습니다. 또한 문서나 테스트를 추가하는 데에도 기꺼이 참여하겠습니다(테스트 가이드라인에 대한 안내를 주신다면요 – 저는 아직 네이티브 Ruby 프로그래머가 아니거든요!).
벤 드림
david
(David Taylor)
4월 29, 2026, 11:00오전
34
기록을 위해: 이제 OIDC에서 그룹 동기화가 지원됩니다. 자세한 내용은 플러그인 주제와 최근 변경 사항 을 확인하세요.