Authentication and Middlewares Flashcards

1
Q

What is an “authsession ID”?

A

An “authsession ID” is a unique identifier associated with an authentication session. It is typically generated when a user logs into a system or application and is used to track the user’s authenticated session throughout their interaction with the system. The authsession ID helps maintain the user’s state and authentication status, allowing them to access protected resources without re-authenticating for each request. It is an essential component of session management and security in web applications.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Why is an “authsession ID” important in web applications?

A

An “authsession ID” is crucial in web applications because it helps maintain user authentication status throughout their session. It allows users to access protected resources without repeatedly entering their credentials, enhancing user experience and security.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How is an “authsession ID” typically stored and managed on the client-side?

A

An “authsession ID” is usually stored on the client-side as a cookie or in local storage. This allows the client to send the session ID with each request to the server, which can then validate the user’s session.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What security considerations should be taken into account when using “authsession ID”?

A

Security is vital when handling “authsession IDs.” Consider implementing secure transmission (HTTPS), protecting against session fixation attacks, and using secure storage mechanisms to prevent unauthorized access or theft of session IDs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the difference between a session ID and a token in authentication?

A

A session ID is typically a server-generated identifier used to track user sessions, while a token can be a self-contained piece of information (e.g., JSON Web Token) that holds user authentication data and can be used for both authentication and authorization.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Can you explain the concept of session hijacking in the context of “authsession ID”?

A

Session hijacking is when an attacker steals a user’s “authsession ID” to impersonate them. To mitigate this risk, session IDs should be securely generated, transmitted over HTTPS, and invalidated after logout or a period of inactivity.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is JWT, and what does it stand for?

A

JWT stands for JSON Web Token. It is a compact, self-contained, and digitally signed token format for securely transmitting information between parties as a JSON object. JWTs are commonly used for authentication and authorization in web applications and APIs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the three parts of a JWT structure?

A

A JWT consists of three parts: Header, Payload, and Signature.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does the “Header” part of a JWT typically contain?

A

The Header contains metadata about the token, such as the type of token (JWT) and the signing algorithm used.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What information is stored in the “Payload” part of a JWT?

A

The Payload contains claims, which are statements about an entity (typically, the user) and additional data. Claims are categorized as standard claims (pre-defined) or custom claims (user-defined).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How is the “Signature” part of a JWT generated and verified?

A

The Signature is created by taking the encoded Header, encoded Payload, and a secret key (or private key, in asymmetric cryptography), and applying a signing algorithm. To verify the signature, the recipient recalculates it using the same algorithm and the known key and compares it to the received signature to ensure the token hasn’t been tampered with.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the primary use case of JWT in web applications?

A

JWTs are commonly used for authentication and authorization. They allow web applications to securely transmit user information (claims) between the client and server, often to verify the user’s identity and grant access to protected resources.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Can JWTs be encrypted in addition to being signed?

A

Yes, JWTs can be encrypted to provide confidentiality. When encrypted, the data in the payload is protected from unauthorized access. This is often used when sensitive information needs to be included in the token.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Give an example of an I/O-based application.

A

Example: Web browsers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Give an example of a CPU-based application.

A

Example: Scientific simulations.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is encoding?

A

Encoding is a process that transforms data into a different format for the purpose of simplification, efficiency, or compatibility.

17
Q

What is encryption?

A

Encryption is a process that transforms data into a secure format to protect its confidentiality.

18
Q

What is a common use of encryption in data security?

A

Encryption is commonly used in data security for securing sensitive information such as credit card numbers and passwords.

19
Q

What is Base64 encoding?

A

Base64 encoding is a method for representing binary data in an ASCII string format.

20
Q

Why is Base64 encoding used?

A

Base64 encoding is used to convert binary data into a text-based format suitable for transmission over text-based channels and inclusion in text-based documents.

21
Q

Is Base64 encoding a form of data encryption or security?

A

No, Base64 encoding is not a form of data encryption or security. It is an encoding method used for data representation and transmission, but it does not provide data protection or confidentiality.

22
Q

What is the primary purpose of OAuth?

A

The primary purpose of OAuth is to enable secure and controlled access to a user’s resources by third-party applications without exposing the user’s credentials.

23
Q

What are the four main roles in the OAuth protocol?

A

The four main roles in OAuth are the Resource Owner, Client, Authorization Server, and Resource Server.

24
Q
A