Comments (3)
hi,
i have the same problem, have you solved it and can give me a hint?
Originally posted by @gnomium at zfcampus/zf-oauth2#130 (comment)
from api-tools-oauth2.
Well, detailing a thorough answer on OAuth2 workflows and architecture would take ages, and here is definitely not the right place.
Briefly, AuthController is not meant to be extended for "business controllers". Its purpose is to handle authentication requests:
- generating / revoking tokens
- handling authorization code...
and upon success, redirect to the requested routes (controller/action).
What you can do indeed, as referred in https://github.com/zfcampus/zf-oauth2#how-to-protect-your-api-using-oauth2, is to inject the server instance (OAuth2\Server) into your controller from its factory and call its methods from your actions ($this->server->verifyResourceRequest...)
Note: forget about this ugly 'onDispatch' call within your controller. Its location should be in a dedicated listener and called from you 'onBootstrap' callback in your module class ;)
Originally posted by @jguittard at zfcampus/zf-oauth2#130 (comment)
from api-tools-oauth2.
Can you please share any code example for injecting the server instance (OAuth2\Server) into controller from its factory and call its methods from actions ?
Originally posted by @fahadonline at zfcampus/zf-oauth2#130 (comment)
from api-tools-oauth2.
Related Issues (20)
- No Authorization Events Fired on Token Request
- Tables DDL doesnt match original HOT 1
- New adapter with "." error HOT 1
- OAuth2ServerFactory is not returning instance of OAuth2\Server HOT 5
- Dist package 1.1.2 has two src folders HOT 4
- Clicking NO does not render error HOT 3
- Wrong response format HOT 1
- Username and password access HOT 3
- OAuth2 Request & Response are not extendable HOT 1
- Psalm integration
- PHP 8.0 support
- Switch to GHA CI workflow
- Switch to GHA CI workflow
- Class 'Webmozart\Assert\Assert' not found
- BcryptTrait.php checkpassword() should accept array, but no longer does
- doctrine configuration HOT 1
- An error occurred during execution
- Redirect if user is not authenticated HOT 1
- remove NOT NULL for client_secret
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from api-tools-oauth2.