Comments (6)
For some reason, content-type: application/x-www-form-urlencoded
works and not application/json
curl --request POST \
--url https://localhost:8080/oauth/token \
--header 'content-type: application/x-www-form-urlencoded' \
--data client_id=CLIENT_ID \
--data client_secret=SECRET \
--data grant_type=password \
--data '[email protected]' \
--data 'password=mypassword'
from oauth2-bundle.
I think the reason is in Section 4.1.3 from RFC 6749:
The client makes a request to the token endpoint by sending the
following parameters using the "application/x-www-form-urlencoded"
format per Appendix B with a character encoding of UTF-8 in the HTTP
request entity-body
If you need to support application/json
content type, maybe you can write a custom grant type.
from oauth2-bundle.
@ajgarlag Thanks for that info. If I am going to write my custom grant type, can I do it on top of trikoder/oauth2-bundle or would you know if there is a configuration where I can attach that custom grant type?
from oauth2-bundle.
I think this bundle does not support custom grant type. Maybe you can open a PR to support it.
from oauth2-bundle.
I'm not sure that even the League Oauth2 server itself supports adding custom grant types. If there is a possibility for that then we welcome any PR that would make that possible in our bundle as well.
from oauth2-bundle.
I took a look in the League code, it is possible to do this. We will follow the progress for that through issue #143
from oauth2-bundle.
Related Issues (20)
- Symfony 5.3 new user interface support HOT 2
- Doctrine Bundle 2.4 support HOT 1
- How to get access token for all types of grants? HOT 3
- PHPDumper throws error on installation, string:OAUTH2_ENCRYPTION_KEY are never used
- How to override/extend Model-Classes for Client, AccessToken, etc
- Restricting routes by scope example HOT 1
- Symfony 5.3 Deprecation issue HOT 4
- in_memory persistence: provide client_id and client_secret from .env files HOT 1
- Writing the tests relying on config
- How can I get data from access token? HOT 2
- Symfony 5.3 Basic Setup, does not work! HOT 2
- [Question] How to manually generate a refresh token?
- Re-using unit test
- 1 package has known vulnerabilities HOT 1
- unexplained Client authentication failed error HOT 1
- Password Grant Flow
- Add Symfony 6 support HOT 2
- phpstan lvl 2 error on dev-master 09462b1 HOT 1
- sensio/framework-extra-bundle dependencya problem with 3.2.0 HOT 1
- is this project still maintained ? HOT 5
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 oauth2-bundle.