Test your detailed understanding of the differences and interactions between authentication and authorization, including concepts around sessions, tokens, and the fundamentals of OAuth2.
Distinguishing AuthN and AuthZ
In a system where Alice successfully logs in with her password and then is denied access when trying to view admin reports, which process failed for her at the report viewing step?
- Authentization
- Authorization
- Authention
- Authentification
- Authentication
Sessions vs. Tokens
Which of the following best describes an access token in comparison to a session ID?
- A session ID contains complete user identity information, while an access token is only a random string.
- An access token is valid indefinitely, while session IDs automatically expire after one minute.
- An access token is typically stateless and self-contained, while a session ID references state stored on the server.
- An access token always requires a persistent database lookup, whereas a session ID never does.
- Both access tokens and session IDs are interchangeable in terms of validation and storage.
AuthN and AuthZ Roles
If a system uses a smart card to verify a user's identity and then checks their job title to grant resource access, how are authentication and authorization applied in this process?
- Both authentication and authorization are achieved by the smart card.
- The job title is responsible for authentication.
- Neither authentication nor authorization is applied.
- The smart card performs authentication; checking the job title implements authorization.
- Authorization comes first, and authentication follows.
Token Scope in OAuth2
What does the 'scope' parameter in an OAuth2 access token request define?
- The permissible actions or resources that the token holder can access
- The access log for a resource
- The expiration date of the token
- The authentication strength required
- The token encryption algorithm
Bearer Tokens Security
Why should bearer tokens be transmitted over secure channels such as HTTPS rather than HTTP?
- Bearer tokens require manual validation in HTTP
- Bearer tokens self-destruct if sent over HTTP
- HTTP cannot parse tokens with certain characters
- They can be intercepted and reused by unauthorized parties since possession of the token grants access
- Bearer tokens encrypt themselves only under HTTPS
Resource Owner Role
In the context of OAuth2, who or what is typically referred to as the 'resource owner'?
- The system process that issues tokens
- The entity that can grant access to a protected resource, usually the end-user
- The developer implementing the client application
- The server that stores the user's data
- The authentication middleware
Impersonation Vs. Delegation
Which describes the concept of delegation in OAuth2 as opposed to impersonation?
- Delegation only applies to server-to-server communication.
- Both delegation and impersonation mean the same in OAuth2.
- Delegation allows a client to act on behalf of a user with the user's permission, whereas impersonation lets a client act as if it is the user without consent.
- Impersonation is safer because it uses refresh tokens exclusively.
- Impersonation always requires two-factor authentication.
Expiration of Sessions and Tokens
When considering session IDs and tokens, why is setting an expiration or lifetime important for security?
- A session or token cannot ever be invalidated without an expiration.
- It completely eliminates the risk of replay attacks.
- It makes tokens easier to memorize for users.
- It reduces the impact if a session or token is compromised by limiting its period of validity.
- Expiration is only required by legacy systems.
Implications of Token Revocation
What happens if an OAuth2 access token is revoked but a previously issued refresh token is still valid and held by the client?
- The access token will automatically restore itself.
- The client can obtain new access tokens until the refresh token itself expires or is revoked.
- Only the original access token remains usable, not new ones.
- All access and refresh tokens immediately self-destruct.
- The client can no longer ever access any resources.
Opaque vs. JWT Tokens
Which statement accurately contrasts opaque tokens and JSON Web Tokens (JWT) in access control?
- JWTs can only be validated over secure TCP protocols.
- JWTs can carry claims about the user and be validated statelessly, whereas opaque tokens require server-side introspection for details.
- Opaque tokens are always longer than JWTs and can be decoded by anyone.
- JWTs include user passwords encrypted inside their payload.
- Only opaque tokens can be used for authentication, JWTs are for authorization only.