Giter VIP home page Giter VIP logo

Comments (6)

warrenca avatar warrenca commented on June 15, 2024 1

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.

ajgarlag avatar ajgarlag commented on June 15, 2024 1

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.

warrenca avatar warrenca commented on June 15, 2024

@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.

ajgarlag avatar ajgarlag commented on June 15, 2024

I think this bundle does not support custom grant type. Maybe you can open a PR to support it.

from oauth2-bundle.

X-Coder264 avatar X-Coder264 commented on June 15, 2024

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.

X-Coder264 avatar X-Coder264 commented on June 15, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.