Steven Choi
Steven Choi

Reputation: 41

Laravel - API Authentication (Passport) - Cipher method not supported

I am new for Laravel PHP framework.

I want to build an api auth, so i have read the Laravel Passport Article.

https://laravel.com/docs/5.4/passport#issuing-access-tokens

I follow the guide until requesting token. There's a route which will redirect back to server for authentication.

Route::get('/redirect', function () {
    $query = http_build_query([
        'client_id' => 'client-id',
        'redirect_uri' => 'http://example.com/callback',
        'response_type' => 'code',
        'scope' => '',
    ]);

    return redirect('http://your-app.com/oauth/authorize?'.$query);
});

When I being redirect to http://myapp.com/oauth/authorize?client_id=4&redirect_uri=http%3A%2F%2Fmyapp.com%2Fcallback&response_type=code&scope= ( Permission asking page )

Then I clicked "Authorize" button, the page shows the error message

Cipher method not supported. This is normally caused by an outdated version of OpenSSL (and/or OpenSSL compiled for FIPS compliance). Please upgrade to a newer version of OpenSSL that supports aes-256-ctr to use this library.

I have stuck in this page. Hope anyone can help

I am working in local via AMPPS(v3.7) and PHP(5.6)

Upvotes: 0

Views: 549

Answers (2)

Hans
Hans

Reputation: 568

I upgraded to a 4.x version of MAMP which fixed it for me.

Upvotes: 1

utdev
utdev

Reputation: 4102

I had a similiar error once and had to put following inside the config/app.php file:

'cipher' => 'AES-256-CBC',

Just go into your config/app.php and look for 'cipher' and paste the code above.

If that does not work, have a look again at the error message:

Please upgrade to a newer version of OpenSSL that supports aes-256-ctr to use this library.

Upgrade the version of OpenSSL

Upvotes: 0

Related Questions