Skip to content

Authentication Error #29

@GianmarcoVarroneDev

Description

@GianmarcoVarroneDev

Hello, I'm trying to implemen this package in my app.
I wrote the following controller :

class RevolutAuthController extends Controller
{

    protected $authProvider;

    public function __construct()
    {
        $this->authProvider = new RevolutAuthProvider([
            'clientId' => getenv('REVOLUT_CLIENT_ID'),
            'privateKey' => file_get_contents(base_path('/privatecert.pem')),
            'redirectUri' => "http://my_domain/api/v1/revolut/auth/callback",
            'isSandbox' => true
        ]);
    }


    public function redirectToProvider()
    {
        return redirect($this->authProvider->getAuthorizationUrl(['scope' => "READ,WRITE,PAY"]));
    }




    public function handleRevolutCallback(Request $request)
    {
        $accessToken = $this->authProvider->getAccessToken('authorization_code', [
            'code' => $request->get('code')
        ]);

        if ($accessToken->hasExpired()) {
            $newAccessToken = $this->authProvider->getAccessToken('refresh_token', [
                'refresh_token' => $accessToken->getRefreshToken()
            ]);

            $accessToken = $newAccessToken;
        }
    }
}

The redirect to provider metod works properly and generates a link where I can authorize the app, the issue comes when i try to authorize the app with sms in the revolut side.

After filling in the authcode revolut says "Action is forbidden" and does not redirect to the redirect URI provided.

I have also tried to authorise the app manually via the revolut dashoboard and in that case it works properly.

Any idea on where the issue colud be?

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions