Sobes.tech
Junior — Middle

What does the term Access Token mean and how is it used in authentication and authorization systems?

sobes.tech AI

Answer from AI

An Access Token is a digital key issued by an authentication system after successful user login. It confirms that the user has been verified and contains information about their access rights.

In authentication and authorization systems, an Access Token is used for:

  • Confirming user rights when requesting access to protected resources.
  • Avoiding the need to re-enter login and password for each request.
  • Limiting access by time — tokens usually have an expiration period.

Example of usage in an iOS app: after login, the user receives an Access Token from the server, which is then attached to HTTP request headers for API access.

let accessToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
var request = URLRequest(url: URL(string: "https://api.example.com/user/profile")!)
request.setValue("Bearer \(accessToken)", forHTTPHeaderField: "Authorization")
// Execute request with token
What does the term Access Token mean and how is it… - sobes.tech