Bonjour,
Tâche planifiée sur mon NAS Synology
Depuis quelques temps mon authentification ne fonctionne plus, j’ai vérifié le client_id et le client_secret RAS.
Quelqu’un rencontre-t-il le même pb (Depuis le 01/07/2023)
Voici mon code d’authentification :
// Renseignez vos identifiants ci-dessous
$password = "*******************";
$username = "*******************";
$app_id = "*******************";
$app_secret = "**********************";
$IP_IPX800 = "192.168.1.XXX";
$API_key = "apikey";
//---fin de paramétrage--
//---Début procédure d'authentification---------------
$token_url = "https://api.netatmo.com/oauth2/token";
$postdata = http_build_query(
array(
'grant_type' => "password",
'client_id' => $app_id,
'client_secret' => $app_secret,
'username' => $username,
'password' => $password
)
);
$options = array(
'http' => array(
'method' => 'POST',
'header' => 'Content-type: application/x-www-form-urlencoded',
'content' => $postdata
)
);
$context = stream_context_create($options);
$response = file_get_contents($token_url, false, $context);
$params = json_decode($response, true);
// Vérification d'erreur pour la requête d'authentification
if (!isset($params['access_token'])) {
die("Erreur d'authentification : Impossible d'obtenir le token d'accès.");
}
Result : Erreur d’authentification : Impossible d’obtenir le token d’accès.
Sur le site de Netatmo il est spécifié une nouvelle méthode d’authentification :
Netatmo Connect | Authentication