# API 认证和Laravel Passport

大多数API需要某种形式的身份验证才能访问部分或全部数据，Laravel 5.2引入了一个简单的“令牌”认证方案，我们将在稍后介绍，但在Laravel 5.3及更高版本中，我们有一个名为Passport的新工具（一个单独的包，通过Composer引入），在应用程序中提供功能齐全的OAuth 2.0服务器，其中包含用于管理客户端和令牌的API和UI组件。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://liseen315.gitbook.io/laravel/bian-xie-apis/api-ren-zheng-he-laravel-passport.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
