我使用AppAuth iOS访问Google Drive,10天前,一切正常,我可以正常从我的驱动器中获取文件。但是今天,(我已经10天没有修改代码了)我不能取文件了,它有这个问题。
Error Domain=org.openid.appauth.oauth_token Code=-10 "invalid_grant: Bad Request" UserInfo={OIDOAuthErrorResponseErrorKey={ error = "invalid_grant"; "error_description" = "Bad Request"; }, NSUnderlyingError=0x600000d1cdb0 {Error Domain=org.openid.appauth.remote-http Code=400 "{ "error": "invalid_grant", "error_description": "坏的请求" }" UserInfo={NSLocalizedDescription={ "error": "invalid_grant", "error_description": "Bad Request"}},request=<NSMutableURLRequest: 0x6000003cdbf0> { URL: https:/www.googleapis.comdrivev3files?fields=kind%2C%20nextPageToken%2C%20files%28id%2C%20mimeType%2C%20kind%2C%20name%2C%20webViewLink%2C%20thumbnailLink%2C%20trashed%2C%20parents%2C%20fileExtension%2C%20modifiedTime%2C%20size%29&prettyPrint=false&q=%27root%27%20IN%20parents。 }, NSLocalizedDescription=invalid_grant: Bad Request}
谁有办法解决这个问题?
现在谷歌驱动器有变化在那里api的我也面临同样的问题,我固定像现在我发送一个头这样的获取文件
var dict = ["Content-Type": "application/json"]
dict["Authorization"] = "Bearer " + authClientAccessToken
它绝对工作!!!!!!!!
在这里输入图片描述Ps:这是我的请求和授权代码。