AZ-400 ยท Identity, access and permissions
GitHub authentication methods
GitHub Apps vs OAuth apps, GITHUB_TOKEN and its permissions block, fine-grained vs classic personal access tokens, deploy keys, SSO enforcement.
Key points
- GITHUB_TOKEN: automatic, per job, limited to the workflow's repository, shaped by the permissions key, expires with the job.
- GitHub App: fine-grained permissions, installation tokens last about an hour, bot without a user.
- OAuth app: broad scopes, acts as the signed-in user.
- Fine-grained PAT: one owner, chosen repositories. Classic PAT: all the user can reach. Both tied to a person.
- SSO: tokens must be authorized for the organization.
Source: https://docs.github.com/en/actions/concepts/security/github_token
Practice questions
Which GitHub credential is created automatically for each workflow job and expires when the job finishes?
- A classic personal access token
- GITHUB_TOKEN
- A deploy key
- An OAuth app client secret
Show answer
Answer: B. GITHUB_TOKEN
GITHUB_TOKEN is issued per job and limited to the repository that contains the workflow. PATs and OAuth tokens are created and stored by people.
Which statements correctly describe GitHub Apps compared with OAuth apps?
- They can request fine-grained permissions, such as issues without code access
- Installation access tokens expire after about one hour
- Installation tokens can work without a signed-in user, as a bot
- Their tokens always act as the authorizing user
- They share the user's 5,000 requests per hour limit
Show answer
Answer: A. They can request fine-grained permissions, such as issues without code access, B. Installation access tokens expire after about one hour, C. Installation tokens can work without a signed-in user, as a bot
GitHub Apps offer targeted permissions, short-lived installation tokens and can act as a bot with no user. Acting only as the authorizing user and sharing that user's 5,000 requests per hour describe OAuth apps.
A fine-grained personal access token can be used to push to a public repository you neither own nor belong to.
Show answer
Answer: False
False. Fine-grained tokens cannot write to public repositories you do not own or belong to; only classic tokens can, which is one reason classic tokens remain in use despite being broader.
Practice 8 questions on this topic in Bitzu
Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.
