-
Notifications
You must be signed in to change notification settings - Fork 780
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
[13.x] Make Passport headless (Support Laravel Jetstream and Breeze) #1771
[13.x] Make Passport headless (Support Laravel Jetstream and Breeze) #1771
Conversation
Thanks for submitting a PR! Note that draft PR's are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface. Pull requests that are abandoned in draft may be closed due to inactivity. |
Hi @driesvints sorry to bother you, I just wanted to ask your opinion before continuing my work on this. I'm gonna add a |
Hey @hafezdivandari. That seems fine for us! Thank you so much for all your work on this 👏 |
@hafezdivandari You've done a great deal of solid work on this throughout the ecosystem and it's much appreciated. I maintain some custom in house sso servers for a handleful of privately owned businesses, and they all use Passort for oauth. They are all running on forge provisioned servers and so we try keep them up to date to stay in line with current forge offerings. In the past the way to use passport with something like breeze or jetstream was to publish the view and modify to our needs, or otherwise place our own stub in the How would this change affect these existing applications? |
Thank you @inmanturbo When the view is on the As stated on the PR description, more views are comming for the new device flow. Each view will have its own method to render the view (just like Fortify) e.g You may also check the upgrade guide entry for more info. |
Passport has a view for authorization / consent, this view doesn't load correctly for many years (maybe since Mix / Bootstrap CSS are not installed on Laravel Skeleton by default). Also more views are needed for Device flow (#1750), makes user experience even worse!
This PR makes Passport headless just like Fortify because Passport doesn't have any pre-installed UI scaffolding. Therefore, we add support for Jetstream and Breeze that already have UI for different stacks:
install:api
during installation unlike Jetstream and Breeze. Let me know if you want a PR for this.Changes
Passport::viewPrefix()
method (inspired by Fortify).Passport::viewNamespace()
(inspired by Fortify).Passport::defaultScopes()
method.Passport::validScopes()
method.User::currentAccessToken()
as an alias forUser::token()
to be interchange with Sanctum.SimpleViewResponse
(inspired by Fortify), to be generic for the future views.Client::firstParty()
method. We consider a client first-party when it doesn't belong to any user.