Good morning, I would like to preface by saying that I have completed the process to activate the web API integrations and successfully received the secret key. As of now, I am following the OAuth2 flow to authenticate.
In the first step I create an authorization URL as follows:
However, the response to the bash request is as follows, despite the client_id and the client_secret are the same present in the nukiâs web-api page:
{"error":"invalid_client","error_description":"Client authentication failed (e.g., unknown client, no client authentication included, or unsupported authentication method). passwords do not match"}
The error suggests that there is a problem with the credentials used to authenticate the client (usually a combination of client ID and client secret). Has your advanced API request been approved? Please validate the client ID & secret again.
Please try to use this curl command to request the access token:
curl -X POST -d âclient_id=CLIENT_ID client_secret=CLIENT_SECRET grant_type=authorization_code code=AUTHORIZATION_CODE redirect_uri=CALLBACK_URLâ https://api.nuki.io/oauth/token
Hello, yes, my advanced API request has been approved. When I request a token (not an AUTHORIZATION_CODE) with my credentials, the API response is correct, and I can use it to authenticate. So, I donât think the credentials are the issue in this case.
To clarify any doubts: the credentials are the ones found on the page Nuki Web on the API page, in the âOAuth2 API key & URLâ section. Specifically, client_id corresponds to âOAuth2 API keyâ and client_secret corresponds to âOAuth2 API Secret,â correct?
Using Swagger (Nuki demo), I have to enter only the client_id, and it works. However, when I use Postman, I receive the same error as when sending data with PHP or Curl (bash).
Hello,
Sorry for the misunderstanding. I tried using the Bash command from the documentation, PHP (with cURL), Postman, and the demo on your site. However, everything except the demo gives me the same error {"error_description":"Invalid client credentials.","error":"invalid_client"}, even though the credential are correct.
Hey ! I am following the OAuth2 flow. I implemented an authorization code link , authorized the client application , received the authorization code but I cannot receive the access token
When I try to exchange the authorization code to receive the access token, I get following error :
{
error: 'invalid_client',
error_description: 'Client authentication failed (e.g., unknown client, no client authentication included, or unsupported authentication method). passwords do not match'
}
It seems that my OAuth2 API Secret (client_secret) is not matching my Oauth2 API key (client_id).