Pinterest中的身份验证代码终结点是什么? [英] What's the auth code endpoint in Pinterest?

查看:160
本文介绍了Pinterest中的身份验证代码终结点是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

该文档非常清楚: http://developers.pinterest.com/api_docs/oauth_code_exchange/

我需要code才能将其与访问令牌交换.但是访问此代码的端点在哪里?尝试了经典":

I need the code for swap it with an access token. But where is the endpoint for access to this code? Tried the "classic" :

https://api. pinterest.com/oauth2/auth?client_id=&redirect_uri=&scope=&response_type=code

但似乎是404.

推荐答案

v3的终结点是:

PUT https://api.pinterest.com/v3/oauth/code_exchange/

示例:

curl -X PUT https://api.pinterest.com/v3/oauth/code_exchange/ -d "access_token={access token}&consumer_id={client id}&consumer_secret={client secret}&redirect_uri={redirect uri}&code={code}&grant_type=authorization_code"

但是奇怪的是,您必须传递有效的访问令牌才能使端点正常工作,否则它将返回未经身份验证的错误.该访问令牌可以来自任何人或任何Pinterest应用程序,并且只要其尚未过期,就不必来自身份验证用户或身份验证应用程序.

What is strange though, is that you have to pass in a valid access token for the endpoint to work or it will return an Unauthenticated error. The access token can be from anyone or any Pinterest app and does not need to be from the authenticating user or the authenticating app, as long as it has not expired.

到目前为止,获得有效访问令牌的最简单方法是在此处登录iPhone的Pinterest,您将在URL哈希中找到该令牌:

The easiest way to obtain a valid access token as of now is to log in to the Pinterest for iPhone app here and you will find the token in the URL hash:

https://www.pinterest.com/oauth/?consumer_id= 1431594& response_type =令牌

这篇关于Pinterest中的身份验证代码终结点是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆