14 - Authentication Flashcards

(49 cards)

1
Q

process of verifying that someone is who they say they are

A

authentication

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

reasons for authentication (3)

A
  1. saving client-client data
  2. customizing user experience
  3. authorization/usage control
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q
  • user’s browsing or activity history
  • list of API calls
A

saving client-client data

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

users have preferences and settings

A

customizing user experience

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q
  • different permissions for admin and regular users
  • limit API calls over a set period of time
A

authorization/usage control

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

involves granting access to resources based on someone’s identity

A

authorization

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

true/false

a user can be authenticated, but not authorized to access a particular resource

A

true

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

what do we need for authentication (2)

A
  1. credentials
  2. authentication token or session id from the server
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

an identity and an authentication factor

A

credentials

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

used for subsequent requests that require authentication

A

authentication token or session id from the server

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

servers remember users with the use of ___ or ____

A

cookies, sessions

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

2 kinds of auth

A
  1. token-based auth
  2. session-based auth
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

the __ gives out tokens to clients

A

authenticating server

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

a string of data

A

token

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

a generic medium of information

A

token

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

true/false

tokens can either be signed or encrypted but not both

A

false, it can be signed, encrypted, both, or neither

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

auth tokens are usually at least ___

A

signed

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

a/an ___ message means that its origin can be verified

A

signed

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

a/an ___ message means that only its intended recipient can read it

A

encrypted

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

true/false

clients send an auth token with every request that needs authentication

21
Q

how does authentication using a token work? (4)

A
  1. client logs in using credentials
  2. client receives auth token
  3. user sends the auth token instead of credentials
  4. server validates the auth token
22
Q

how does session-based authentication work? (4)

A
  1. client logs in using credentials
  2. client receives a reference to the session
  3. user sends the session ID with subsequent requests
  4. server checks if session is still valid
23
Q

users use their ___ to maintain their logged in state in session-based auth

24
Q

what is the difference between session-based auth and token-based auth in terms of session info?

A

session-based auth: the server keeps all the session data

token-based auth: all session info can be kept in the token

25
true/false credentials should be sent over the network as frequent/as much as possible to maintain their logged in status
false, it should be sent as little as possible since these are sensitive information
26
small piece of data that the server sends to the user's browser via a header in the response message
cookie
27
cookies are typically used by the server to tell if ____
2 requests came from the same browser
28
uses for cookies (3)
1. session management 2. personalization 3. tracking
29
types of cookies (2)
1. session cookies 2. permanent cookies
30
this type of cookies have an expiry date and time set during its creation and are automatically deleted by the browser
permanent cookies
31
this type of cookies don't have a specified expiry, they are deleted when the browser shuts down
session cookies
32
true/false session cookies can be restored
true, it can be restored using a browser feature called session restoring
33
true/false session cookies are practically permanent
true, it is because of session restoring
34
cookies that are inaccessible via JS/DOM methods; they are only stored, and sent directly to the server
Secure/HttpOnly Cookies
35
the things that cross-site scripting attacks want to steal
cookies
36
in practice, what is the usual size limit for cookies?
~4KB
37
2 options for storing data in the server
1. Main memory 2. Database storage
38
options for token storage on client side (4)
1. browser sessionStorage 2. browser localStorage 3. cookies 4. a variable in a program/main memory
39
forms of browser storage introduced in HTML 5 (2)
1. session storage 2. local storage
40
data in local/session storage is associated with a/an ___
origin
41
options for sending auth tokens to a server (3)
1. as a cookie 2. in the authorization header of a request 3. in the url
42
how are auth tokens sent as a cookie
``` Cookie: auth_token = ```
43
how are auth tokens sent in the auth header
``` Authorization: Bearer ``` *Bearer is an Authorization type
44
how are auth tokens sent in the url
``` http://www.sample.com/dashboard?auth_token= ```
45
which can store more data, a cookie or the web storage API's localStorage and sessionStorage
the web storage API's localStorage and sessionStorage can store more data
46
in practice, which authentication method/s do web apps commonly use?
a combination of both token and session-based auth is used
47
without this, a middleman can read the contents of all the messages that users exchange with a server
TLS (HTTPS)
48
authentication tasks for server (2)
1. give out tokens to authenticated clients 2. verify validity of tokens sent by clients
49
authentication tasks for client (2)
1. store the auth token received from server 2. send auth token to server again whenever necessary