Bitzu

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

Single choice

Which GitHub credential is created automatically for each workflow job and expires when the job finishes?

  1. A classic personal access token
  2. GITHUB_TOKEN
  3. A deploy key
  4. 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.

Select all that apply

Which statements correctly describe GitHub Apps compared with OAuth apps?

  1. They can request fine-grained permissions, such as issues without code access
  2. Installation access tokens expire after about one hour
  3. Installation tokens can work without a signed-in user, as a bot
  4. Their tokens always act as the authorizing user
  5. 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.

True or false

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.

Download on the App StoreGet it on Google Play

More AZ-400 topics in this module