Azure OIDC for SSH certs: Fetch a list of user groups via Microsoft Graph API
Maintainers usually reply within 1 day
@hslatman is already working on this.
Since Jul 29, 2025.
Assessment
This issue has not been assessed yet.
Description
Hello!
- Vote on this issue by adding a 👍 reaction
- If you want to implement this feature, comment to let us know (we'll work with you on design, scheduling, etc.)
Issue details
Allow configuring an extra API endpoint to call as part of the SSH cert issuance process. This info could then be made available to the template file, e.g., as .Custom (here).
A concrete example would be calling the Microsoft Graph API to fetch a list of groups the user belongs to. Then, in the template, we could do something like "Principals": {{ toJson .Custom.groupIds }}.
I haven't looked at other OIDC providers, but this could potentially be generic?
Why is this needed?
Our specific example looks something like this:
- We have lots of servers (~300 or so)
- Each server has a single user account
- Staff are granted access server-by-server
To facilitate that, we're using an Azure OIDC provisioner, with a template like this:
{
"type": "{{ .Type }}",
"keyId": "{{ .KeyID }}",
// the principals will be a list of Azure group IDs
"principals": {{ toJson .Token.groups }},
"extensions": {{ toJson .Extensions }},
"criticalOptions": {{ toJson .CriticalOptions }}
}
Then, we create an Azure group for each server, and place the Object ID of that group into the AuthorizedPrincipalsFile on the server.
The result is: When a user first logs-in, they go through an OAuth login flow, which issues them an SSH cert containing a list of Object IDs of the groups they're in. When they connect to a server, they'll be allowed/denied based on those Group IDs.
This was actually working great, until we hit Azure's 200 group limit for JWTs.
Long story short, if the user has more than 200 groups, Azure will totally omit all groups, and instead suggests to fetch a list of user groups via the Microsoft Graph API (see the ~middle paragraph here). It seems our only option is to fetch a list of groups as a separate API call.
- Dominant language
- Go
- Stars
- 8.9k
- Forks
- 599
- Avg merge
- 21h 20m
- Merged PRs (30d)
- 15
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from smallstep/certificates
-
bug needs triage
Difficulty 1/5 Under an hour Newbie friendliness 84/100
smallstep/certificates#2863 ·
Maintainers usually reply within 1 day
-
needs triage
Difficulty 1/5 Under an hour Newbie friendliness 65/100
smallstep/certificates#2788 ·
Maintainers usually reply within 1 day
-
enhancement needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
smallstep/certificates#2730 · 1 comment · 2 reactions ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
smallstep/certificates#2860 · 2 comments ·
Maintainers usually reply within 1 day
-
[Bug]: Tokens fail validation after the identity provider rotates its signing key until the JWKS cache expiresPossibly taken @APWHY claimed this 100 days ago. Openbug needs triage
Difficulty 3/5 1-2 days Newbie friendliness 35/100
smallstep/certificates#2831 · 3 comments ·
Maintainers usually reply within 1 day
All issues in smallstep/certificates
Similar issues
-
enhancement good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
-
go good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Azure/prometheus-collector#1828 · 1 comment ·
Maintainers usually reply within 2 days