lib/rodauth/features/oauth.rb in rodauth-oauth-0.4.2 vs lib/rodauth/features/oauth.rb in rodauth-oauth-0.4.3
- old
+ new
@@ -622,12 +622,12 @@
auth_url = URI(authorization_server_url)
http = Net::HTTP.new(auth_url.host, auth_url.port)
http.use_ssl = auth_url.scheme == "https"
request = Net::HTTP::Post.new(introspect_path)
- request["content-type"] = json_response_content_type
+ request["content-type"] = "application/x-www-form-urlencoded"
request["accept"] = json_response_content_type
- request.body = JSON.dump({ "token_type_hint" => token_type_hint, "token" => token })
+ request.set_form_data({ "token_type_hint" => token_type_hint, "token" => token })
before_introspection_request(request)
response = http.request(request)
authorization_required unless response.code.to_i == 200