iOS OAuth2客户端机密参数在Google凭据中不可用
我已经创建了一个新项目,并生成了一个新的OAuth 2.0客户端ID,但在凭据中似乎没有任何可用的客户端机密。OAuth 2.0用于移动和桌面应用程序的文档:步骤5说明需要提供此参数 这是一个请求:iOS OAuth2客户端机密参数在Google凭据中不可用,ios,oauth-2.0,google-api,Ios,Oauth 2.0,Google Api,我已经创建了一个新项目,并生成了一个新的OAuth 2.0客户端ID,但在凭据中似乎没有任何可用的客户端机密。OAuth 2.0用于移动和桌面应用程序的文档:步骤5说明需要提供此参数 这是一个请求: ▿ https://oauth2.googleapis.com/token ▿ url : Optional<URL> ▿ some : https://oauth2.googleapis.com/token - _url : https://oauth2.goo
▿ https://oauth2.googleapis.com/token
▿ url : Optional<URL>
▿ some : https://oauth2.googleapis.com/token
- _url : https://oauth2.googleapis.com/token
- cachePolicy : 0
- timeoutInterval : 30.0
- mainDocumentURL : nil
- networkServiceType : __C.NSURLRequestNetworkServiceType
- allowsCellularAccess : true
▿ httpMethod : Optional<String>
- some : "POST"
▿ allHTTPHeaderFields : Optional<Dictionary<String, String>>
▿ some : 1 element
▿ 0 : 2 elements
- key : "Content-Type"
- value : "application/x-www-form-urlencoded; charset=utf-8"
▿ httpBody : Optional<Data>
▿ some : 372 bytes
- count : 372
▿ pointer : 0x00007fce7b5186f0
- pointerValue : 140524808931056
- httpBodyStream : nil
- httpShouldHandleCookies : true
- httpShouldUsePipelining : false
▿ https://oauth2.googleapis.com/token
▿ url:可选
▿ 一些:https://oauth2.googleapis.com/token
-_网址:https://oauth2.googleapis.com/token
-缓存策略:0
-timeoutInterval:30.0
-main文档URL:nil
-networkServiceType:\uu C.NSURLRequestNetworkServiceType
-AllowCellularAccess:正确
▿ httpMethod:可选
-一些人:“帖子”
▿ 所有HttpHeaderFields:可选
▿ 一些:1个要素
▿ 0:2个元素
-关键字:“内容类型”
-值:“application/x-www-form-urlencoded;charset=utf-8”
▿ httpBody:可选
▿ 部分:372字节
-计数:372
▿ 指针:0x00007fce7b5186f0
-指针值:140524808931056
-httpBodyStream:nil
-httpShouldHandleCookies:对
-HttpShouldUsePipeline:false
请求正文数据包含用于成功获取有效授权代码的客户机id、重定向uri和代码验证器的完全相同的参数值
任何没有客户端密码或使用空字符串的请求都返回400。任何使用空字符串以外的任何内容的请求都将返回401,无效的\u客户端错误 这里有一个指向文档的链接:
以下是该项目的链接:
有什么想法吗?当我应该使用初始代码验证器时,我正在使用代码挑战来交换访问令牌的身份验证代码。关于代码流的Spotify授权指南帮助我发现了错误。请求正文的格式是什么?它是一个包含uft8编码字符串的NSData对象。该字符串是一个URLComponents查询。