Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
375 views
in Technique[技术] by (71.8m points)

encryption - DecryptException in BaseEncrypter.php line 48: The MAC is invalid. laravel 5.2

I know this question has already been asked. But none of them solve my issue.

I am facing the issue : DecryptException in BaseEncrypter.php line 48: The MAC is invalid.

I checked my .env file there is no space in APP_DEBUG and APP_KEY

Tried to generate new key but nothing worked out.

Laravel Framework version 5.2.45

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

After surfing for around two hours , tried so many solution form different sources but none of them solved my problem.

  1. There may be reason then .env file have space in APP_DEBUG and APP_KEY key.

    By removing the space if exists can solve the problem.

  2. By clearing cache, composer dump-autoload can also be used in some cases.

  3. But in my case the issue was either

    DecryptException in BaseEncrypter.php line 48: The MAC is invalid

    or

    DecryptException in BaseEncrypter.php line 45: The payload is invalid

    The issue was because of database column issue.

    The column type was varchar and length was 256 that was creating whole issues. As field mwsAuthToken has lenght more then filed 256 and was truncating the mwsAuthToken key value.

    Thus by changing the field type to text solved my problem.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...