我使用的OAuth2宝石,用于制造client_credential认证。 我的代码如下,
require 'oauth2'
client = OAuth2::Client.new("my_client_id", "my_client_secret", :site => "my_site_url", :token_url => "oauth2/token")
client.client_credentials.get_token
当我执行上面的代码块,其与下面的错误响应,
OAuth2::Error (invalid_client: Client authentication failed (e.g., unknown client, no client authentication included, or unsupported authentication method))
{
"error":"invalid_client","error_description":"Client authentication failed (e.g., unknown client, no client authentication included, or unsupported authentication method)",
"error_hint":"The OAuth 2.0 Client supports client authentication method "client_secret_basic", but method "client_secret_post" was requested.
You must configure the OAuth 2.0 client's "token_endpoint_auth_method" value to accept "client_secret_post".","status_code":401}
我检查了使用“网/ HTTP”库,我的client_id
和client_secrets
是有效的和工作。
我看到的唯一问题是与验证方法如在上述消息的暗示说,
The OAuth 2.0 Client supports client authentication method "client_secret_basic", but method "client_secret_post" was requested. You must configure the OAuth 2.0 client's "token_endpoint_auth_method" value to accept "client_secret_post"
我想知道的是什么?
- 怎样
OAuth2
宝石决定使用client_secret_post VS client_secret_basic? 我的意思是我怎么能在创业板的OAuth2要求client_secret_basic? - 如果没有上述那么,我应该如何指定token_endpoint_auth_method到Accpet头client_secret_post?