Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Syncers for synchable Id-Providers #2623

Open
leoncamel opened this issue Jan 18, 2024 · 9 comments
Open

feat: Syncers for synchable Id-Providers #2623

leoncamel opened this issue Jan 18, 2024 · 9 comments
Assignees
Labels
enhancement New feature or request

Comments

@leoncamel
Copy link

leoncamel commented Jan 18, 2024

Currently, it seems casdoor only support database syncer.

In the case, we use AzureAD/WeCom as idP. It will also need some syncer for API-like Id-Providers. For example in this case, the admin role can only modify user info, or assign roles, after the specific user logged in.

So, I think, we need some way to solve this issue:

  1. Extend Id-Provider interface with sync()? For example, AzureAD provide Microsoft Graph API, and MS Graph's Golang SDK. And other Id-Providers may provide similiar APIs
  2. Refactor Syncer interface, for non-database like syncers, like: HTTP based? or external application ?

Any comments about this feature request?

@casbin-bot
Copy link
Contributor

@casbin-bot casbin-bot added the question Further information is requested label Jan 18, 2024
@hsluoyz hsluoyz added enhancement New feature or request and removed question Further information is requested labels Jan 18, 2024
@hsluoyz
Copy link
Member

hsluoyz commented Jan 18, 2024

@leoncamel sounds good. Can you split the syncers to different issues? One issue for one syncer. Because one syncer itself is a big code change itself

@leoncamel
Copy link
Author

@hsluoyz Sure, I will submit idP related syncer as new issue. This issue remains as a umbrella issue to discuss general concepts.

@leoncamel
Copy link
Author

leoncamel commented Jan 18, 2024

I add split it into #2624, #2625.

Currently, we have many Id-Providers, but not all of them are syncable/sychronisable. Some Id-Provider support additional APIs for Listing Users. Further more, some Id-Provider provide incremental APIs, like Microsoft's Graph API, which make its Syncer become a Stateful Syncer(since it need store last checkpoint position).

I just did a quick survey about these Id-Providers:

Provider Name Syncable Incremental Syncable
ADFS
AliPay
AzureADB2C
Baidu
Custom
Casdoor
DingTalk Yes
Douyin
Facebook
Gitee
Github
Gitlab Yes
Google
Goth
Infoflow Internal
Inforflow 3rd-party
Lark
Linkedin
MetaMask
Okta
QQ
Web3Onboard
WeChat
WeChat MiniProgram
WeCom Internal Yes #2625
WeCom 3rd-party Yes #2625
Weibo

Correct me if I was wrong.

@leoncamel leoncamel changed the title feat: Syncer for AzureAD and WeCom feat: Syncers for synchable Id-Providers Jan 18, 2024
@hsluoyz
Copy link
Member

hsluoyz commented Jan 19, 2024

@leoncamel can you make PR?

@leoncamel
Copy link
Author

leoncamel commented Jan 21, 2024

@hsluoyz

OK. We will try to make PR for this. But, I think it involve big refactor on frontend & syncer interface and some core logic. And we are not sure if this PR will match casdoor's rodmap.

We will give try to make first PR to open discussion on this.

@hsluoyz
Copy link
Member

hsluoyz commented Jan 21, 2024

@leoncamel I think this can be implemented by a new syncer. There's no need to build on top of the OAuth provider. They use different APIs and have nothing much shared in common.

@leoncamel
Copy link
Author

@hsluoyz Yes.

But, I not sure how to share parameters between idP and its syncer. For the WeCom case, they may share ClientID and ClientSecret?

Any thoughts?

@hsluoyz
Copy link
Member

hsluoyz commented Jan 21, 2024

@leoncamel no need to share. Just store it in syncer object for a second time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants