Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Oauth2 Server Laravel Laravel Package

lucadegasperi/oauth2-server-laravel

View on GitHub
Deep Wiki
Context7

Middlewares

This package comes with four different middlewares to make the integration into Laravel much easier.

OAuthMiddleware

This is the core middleware which should be used in almost all cases for authoring requests.

OAuthClientOwnerMiddleware

Use this middleware to check if the current authorization request owner is of the type client. This middleware is associated with the client_credentials grant.

OAuthUserOwnerMiddleware

Use this middleware to check if the current authorization request owner is of the type user. This middleware is associated with the password grant.

Note: this middleware is required in order to fetch the current resource owners ID.

CheckAuthCodeRequestMiddleware

Use this middleware to check access tokens on the client after successfully authenticating the resource owner and obtaining authorization. This middleware is associated with the authorization_code grant.

Order

Please note that the middlewares has to be applied in a certain order. The OAuthMiddleware has to be added before the OAuthClientOwnerMiddleware and the OAuthUserOwnerMiddleware.

public function __construct()
{
    $this->middleware('oauth');
    $this->middleware('oauth-user');
}

If the middlewares isn't in the correct order, methods like the Authorizer::getResourceOwnerId() wont work.


← Back to start

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
emuniq/filament-browser-notifications
syriable/filament-translator
hungnm28/livewire-form
wenprise/eloquent
crudly/encrypted
fadion/bouncy
cuci/prototurk-sdk
gos/pubsub-router-bundle
cuci/prototurk-sdk-symfony
clementtalleu/easyadmin-markdown-bundle
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui