「アクセストークン」を発行すると、 {"returnCode":"99","returnMessage":"UnexpectedError"} が得られました

SAnjanaa_f9665b

2023.03.09既読 1071

Hello,
It seems that I need an access token to use LINE WORKS API 2.0, but I haven't been able to get it.
I issued a Service Account from the Developer Console and generated a JWT using the account credentials. However, when I try to issue an access token, I get an "Invalid JWT value" response. I've checked the token generation procedure but it doesn't seem to work. .
I try to get access token with below Request URL
I was doing the following service account authentication in PHP
$headers_encoded = $this -> base64url_encode ( json_encode ( $headers ));  
     
      $payload_encoded = $this -> base64url_encode ( json_encode ( $payload ));  
      $signature = hash_hmac ( 'sha256' , " $headers_encoded . $payload_encoded " , $secret );    
      $signature_encoded = $this -> base64url_encode ( $signature );  
   $jwt = " $headers_encoded . $payload_encoded . $signature_encoded " ;  
However, the authentication server returns a 400 error response
{
  "error_description" : "JWT token is not valid." ,
  "error" : "invalid_request" ,
}
​I checked the validity of the JWT at https://jwt.io/ which also shows an invalid signature.
Content:
assertion= eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.{JSON Claim set BASE64 encoded}.{signature BASE64 encoded}
grant_type= urn:ietf:params:oauth:grant-type:jwt-bearer
client_id=MY_CLIENT_ID
client_secret=MY_CLIENT_SECRET
scope=bot
(JSON claim set, signature, private key are real)
Thank you very much.

コメント0

前の投稿組織に所属するメンバーの人数確認
次の投稿リフレッシュトークンのrevoke(削除)APIはあるのか?
リスト

まだ、解決できませんか?
今すぐ実際に使用しているLINE WORKSユーザーに質問してみましょう。