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

Reinviting org members thorugh API does not support reinstating privileges #388

Open
audunsolemdal opened this issue Mar 25, 2021 · 2 comments

Comments

@audunsolemdal
Copy link

https://github.com/github/platform-samples/blob/master/api/powershell/invite_members_to_org.ps1

So through the GUI if you invite users who have been part of the org recently, you get these options to reinstate privileges which is great

image

I checked the network tab and it makes a POST request towards
https://github.com/orgs/equinor/invitations?invitee_id=<github_id>&role=reinstate

This doesn’t seem to happen / be available when making the call through the API though
https://docs.github.com/en/rest/reference/orgs#create-an-organization-invitation

We tested removing a user, inviting them through the script. The invite works, but the privileges are not reinstated. The person had lost access to their repos + starred equinor repos (assuming this is because he lost repo access, assuming also access to Github teams etc.

Since this isn’t supported through the API call, I assume this also means that the SCIM provisioning which re-invites removed org members also makes them start fresh, which is sub-optimal for our use case.

I’ve also had reports earlier that re-instated members also have had their personal access tokens / ssh keys “lost”, which probably means they mean have been de-authortized from using SSO to the org. I have not verified if or when this happens myself.

@matmut7
Copy link

matmut7 commented Aug 14, 2023

Hi, did anyone find something about reinstating a member through the API ?

@YazanNoon
Copy link

you can use the API that creates invitations https://docs.github.com/en/rest/orgs/members?apiVersion=2022-11-28#create-an-organization-invitation
but instead of using one of the roles mentioned in the docs you can use the role "reinstate"

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

No branches or pull requests

3 participants