Spring Oauth2.0 Missing grant type

14,981

OAuth2 doesn't support JSON in the access token request.You can check here for description..It requires application/x-www-form-urlencoded

Share:
14,981
Parth Solanki
Author by

Parth Solanki

I'm a full-stack developer with having over 7 years of Experience in Java/JS related technologies. Technical Summary :: Java: J2SE, J2EE, JDBC, REST, Servlets, Swing, AWT, Java Beans, Java Mail, JMS. ORM: Hibernate, Spring JdbcTemplate, Spring Data Frameworks: Spring MVC, Spring Boot, Spring Integration, Spring Security, Struts RDBMS: PostgreSQL, MySQL, Oracle, MSSQL NoSQL: ElasticSearch, Neo4J, MongoDB, Redis, Memcached Index server: Apache Solr Cloud back end: Firebase, Google Cloud Functions, AWS JavaScript: TypeScript, JQuery, NodeJS , Angular JS, Angular 6 Design: Bootstrap 3, Custom CSS Design, Media Query, HTML5, JSP, Thymeleaf Test Tools: JUnit, Spring Test, Mockito, MockMVC, Integration Test, Unit Test Scraping: Jsoup, Html Unit, Selenium DevOps: Docker, AWS, DigitalOcean Third-Party Integration: Amazon Web Services, Twilio, Social Media Integration, Payment Integration, and others. Data Science & Analytics : Data Extraction, Data Mining, Data Processing, Data Visualization My Skype - parthsolanki49

Updated on June 14, 2022

Comments

  • Parth Solanki
    Parth Solanki almost 2 years

    I am using Spring Oauth 2.O.

    When I pass request as a form-data it works fine, but when I try to pass data in application/json format it gives me error missing grant type.

    Request

    http://localhost:8080/oauth/token
    
    {"username":"parths","password":"123456","grant_type":"password"}
    

    Error I getting.

    {
      "status": "0",
      "message": "Missing grant type"
    }
    

    Please Guide.