Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authentication Error #29

Open
GianmarcoVarroneDev opened this issue May 8, 2023 · 0 comments
Open

Authentication Error #29

GianmarcoVarroneDev opened this issue May 8, 2023 · 0 comments

Comments

@GianmarcoVarroneDev
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant