Home Learn Temporary GitHub access

Integration

Temporary GitHub organization access

Also searched as temporary GitHub team membership, time-limited GitHub org access, and automatically removing someone from a GitHub organization.

Of the platforms worth governing, GitHub is the one with no answer of its own. That turns out to be the clearest case for putting the expiry somewhere else.

GitHub has no time-bound team membership. A user is on a team or is not, and nothing in the membership records when it should end. Nothing in GitHub — not teams, not organization roles, not repository permissions — takes a duration, so every expiring GitHub access you have ever seen was enforced by something outside GitHub.

The two things that look like an answer and are not

Invitations expire. Membership does not.

An organization invitation that is not accepted expires after seven days, which is a real expiry and is why "GitHub access expires" turns up in search results. It is an expiry on the offer. The moment somebody accepts, the seven days are spent and the membership that results has no end date at all. Worth knowing for a different reason too: an invitation generated by a SCIM request from your identity provider does not expire on that schedule.

Team synchronisation moves membership. It does not time it.

GitHub Enterprise Cloud can synchronize team membership from an identity provider group, which is genuinely useful and is the right way to run standing membership. It has no time dimension of its own — it mirrors the IdP group, so whatever governs that group governs GitHub. If the IdP group has no expiry either, synchronising it faithfully reproduces that. The clock has to exist somewhere, and team sync is not where.

So the expiry lives outside GitHub. Where?

In practice, one of three places, and they are the same three you end up with on every platform that offers nothing:

The credential decision, which matters more than it looks

Whatever removes members has to authenticate, and there are two shapes of GitHub credential. The difference is not convenience.

A personal access token belongs to a person. It carries what that person can do, its actions are attributed to them, and it dies with their account. That last clause is the problem: the day the admin who set it up leaves, offboarding revokes your access management, and nobody connects the two events. An OAuth App does not help — it only ever obtains user-to-server tokens, so its calls are still a human's.

A GitHub App installation is the only GitHub credential owned by the organization. Its permissions are declared by the app and granted at install time, its calls are attributed to the app, and no departure revokes it. If you build the scheduled-job version, build it on an App. It is more work at setup and it is the difference between a control that survives staff turnover and one that does not.

A GitHub 403 that is not a permissions problem

GitHub's REST API requires a User-Agent header. Without one it answers 403 "Request forbidden by administrative rules" — which reads exactly like a scope or permission failure and sends people to re-issue credentials that were fine. If a working token starts failing with that message, check the header before the permissions.

How TemprBac does it

TemprBac holds the expiry itself and calls GitHub's REST API to add and remove team members, so GitHub gets time-bound membership without GitHub needing to support it — and the same package can carry a GitHub team alongside groups in Entra ID, Okta, Google Workspace, AWS IAM and on-premises Active Directory, under one end time.

The GitHub-specific details:

What this does not do

TemprBac grants and revokes organization team membership. It does not manage outside collaborators added directly to a repository, repository-level permissions set per user rather than per team, or anything about the code — and it is not your identity provider, so GitHub sign-in and whatever SSO you enforce on it are unchanged. GitHub also does not return email addresses in team member listings unless the credential has elevated scope, so a member's address may simply be blank in a roster view.

Access that expires on its own

Time-bound GitHub team membership alongside the other systems you already run, revoked automatically when the window closes.

Join the waitlist