You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello. I have a standalone ReactJS app, and I am creating an authentication service in another Laravel app.
This is an issue, because it seems like Passport fully relies on passport routes. Maybe I am wrong, but that's what I understood. And this is, at this point, making me desperate to find a solution. My whole workflow has stopped to figure this issue out.
This makes this a little bit complicated since I can not use sessions. Regardless of that, by following Passport's documentation, this is what I did:
<?php
namespace App\Models\Passport;
use Laravel\Passport\Client as BaseClient;
class Client extends BaseClient
{
/**
* Determine if the client should skip the authorization prompt.
*/
public function skipsAuthorization(): bool
{
return $this->firstParty(); // Skip authorization for first-party clients
}
}
Then, I created the client:
php artisan passport:client
Which user ID should the client be assigned to? (Optional):
>
What should we name the client?:
> ServiceName
Where should we redirect the request after authorization? [http://app.test/auth/callback]:
> http://localhost:5173/auth/callback
INFO New client created successfully.
Client ID ................................................................................................... 9e16a70a-34d3-4a4c-b7c0-734b1cbe9791
Client secret ........................................................................................... 8Htimi8GgUbEL8uGdkKjowtZsgm0HQZbJ4kL1w9l
Here is where things get complicated: I implemented a TOTP 2FA flow, which makes it impossible for me to use password type of grant since those were verified first. Moreover, as I am using ReactJS, I need to proxy the whole token issuance.
This is how I am trying to handle the token issuance after TOTP verification:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello. I have a standalone ReactJS app, and I am creating an authentication service in another Laravel app.
This is an issue, because it seems like Passport fully relies on passport routes. Maybe I am wrong, but that's what I understood. And this is, at this point, making me desperate to find a solution. My whole workflow has stopped to figure this issue out.
This makes this a little bit complicated since I can not use sessions. Regardless of that, by following Passport's documentation, this is what I did:
Then, I created the client:
Here is where things get complicated: I implemented a TOTP 2FA flow, which makes it impossible for me to use password type of grant since those were verified first. Moreover, as I am using ReactJS, I need to proxy the whole token issuance.
This is how I am trying to handle the token issuance after TOTP verification:
But I am not sure how to handle this token issuance. The documentation seems to be forcing the user to access a route within the laravel's project.
In the front-end, I am doing the following:
The front-end APP_URL makes no sense, I know. But I am completely lost on how to handle this without accessing the web routes within my laravel app.
Any help would be extremely appreciated. Cheers
Beta Was this translation helpful? Give feedback.
All reactions