MIC Generation Problem?

Hi, may be I have a general underatnding problem but when tying OTAA I get the following log outut:

Aug 26 10:04:42 v22019048179986779 lora-app-server[24944]: time=“2019-08-26T10:04:42+02:00” level=info msg=“js: request received” message_type=JoinReq receiver_id=0000000000000000 sender_id=000012 transaction_id=2209757055
Aug 26 10:04:42 v22019048179986779 lora-app-server[24944]: time=“2019-08-26T10:04:42+02:00” level=info msg=“js: sending response” message_type=JoinAns receiver_id=000012 result_code=MICFailed sender_id=0000000000000000 transaction_id=2209757055
Aug 26 10:04:42 v22019048179986779 loraserver[24900]: time=“2019-08-26T10:04:42+02:00” level=error msg=“processing uplink frame error” data_base64=“AAAAAAAAAAAAR9AA1d1hUmBDW0MyZRM=” error=“join-request to join-server error: response error, code: MICFailed, description: invalid mic”

Means, the join request is decoded correctly on the app server but the generation of the MIC for the JOINANS packet fails. How can this be ?

It means that the join-request MIC is invalid (thus the MIC in the uplink frame sent by the device). JoinAns is the response object returned by the LoRa App Server Join-Server API (see LoRaWAN Backend Interfaces specification).

Thanks, now I know where to debug and search.