我一直在阅读OAuth,它一直在谈论端点。端点到底是什么?


当前回答

到目前为止发布的所有答案都是正确的,端点只是通信通道的一端。在OAuth的情况下,有三个端点需要关注:

Temporary Credential Request URI (called the Request Token URL in the OAuth 1.0a community spec). This is a URI that you send a request to in order to obtain an unauthorized Request Token from the server / service provider. Resource Owner Authorization URI (called the User Authorization URL in the OAuth 1.0a community spec). This is a URI that you direct the user to to authorize a Request Token obtained from the Temporary Credential Request URI. Token Request URI (called the Access Token URL in the OAuth 1.0a community spec). This is a URI that you send a request to in order to exchange an authorized Request Token for an Access Token which can then be used to obtain access to a Protected Resource.

其他回答

端点,在OpenID身份验证术语中,是将身份验证请求发送(POST)到的URL。

摘自谷歌身份验证API

要获得谷歌OpenID端点,可以通过向https://www.google.com/accounts/o8/id发送get或HEAD HTTP请求来执行发现。当使用GET时,我们建议将Accept报头设置为“application/xrds+xml”。谷歌返回一个包含OpenID提供者端点URL的XRDS文档。端点地址被注释为:

<Service priority="0">
<Type>http://specs.openid.net/auth/2.0/server</Type> 
<URI>{Google's login endpoint URI}</URI> 
</Service>

一旦您获得了谷歌端点,您就可以向它发送身份验证请求,并指定适当的参数(可在链接页面上获得)。通过向URL发送请求或发出HTTP POST请求连接到端点。

简单的回答:“端点是对消息通道末端建模的抽象,系统可以通过它发送或接收消息”(Ibsen, 2010)。


端点vs URI(消除歧义)

端点与URI不同。一个原因是URI可以驱动到不同的端点,比如一个端点到GET,另一个端点到POST,等等。例子:

@GET /api/agents/{agent_id} //Returns data from the agent identified by *agent_id*
@PUT /api/agents/{agent_id} //Update data of the agent identified by *agent_id*

端点与资源(消除歧义)

端点与资源不同。一个原因是不同的端点可以驱动到相同的资源。例子:

@GET /api/agents/{agent_id} @Produces("application/xml") //Returns data in XML format
@GET /api/agents/{agent_id} @Produces("application/json") //Returns data in JSON format

端点是用于与API通信的URL模式。

端点是通过网络访问的服务、工具或应用程序的“连接点”。在软件世界中,任何正在运行并“监听”连接的软件应用程序都使用端点作为“前门”。当您希望连接到应用程序/服务/工具以交换数据时,您将连接到其端点

API代表应用程序编程接口。它是应用程序通过端点与其他应用程序交互的一种方式。相反,您可以为您的应用程序构建一个API,供其他开发人员通过HTTP方法使用/连接,这些方法是RESTful的。具象状态传输(REST):

GET:从API端点检索数据。 PUT:通过API更新数据——类似于POST,但更多的是更新信息。 POST:向API发送数据。 DELETE:从给定API中删除数据。 补丁:更新数据。