我正在尝试为访问代码交换授权代码,但出现错误消息,提示“ redirect_uri_mismatch”。
我等了约8个小时,以防万一需要更新,但到目前为止还没有运气。
The redirect uri's are set correctly, as you can see from the image here.
初始前端重定向/请求:
GET => https://accounts.google.com/o/oauth2/v2/auth
?scope=https://www.googleapis.com/auth/youtube.readonly
&include_granted_scopes=true
&state=state_parameter_passthrough_value
&redirect_uri=http://localhost:4200/profile?platform=youtube
&access_type=offline
&response_type=code
&client_id=[HIDDEN]
解析代码后,我将代码交换为访问代码:
POST => https://oauth2.googleapis.com/token
?client_id=[HIDDEN]
&client_secret=[HIDDEN]
&code=[HIDDEN]
&grant_type=authorization_code
&redirect_uri=http://localhost:2222/youtube/oauth
响应:
data: {
error: 'redirect_uri_mismatch',
error_description: 'Bad Request'
}