Advertise only the header bearer method in the resource metadata

Open Beginner friendly
#58 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
1-3 hours
Newbie friendliness
85/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
php

Research direction

Open modules/simple_oauth_server_metadata/src/Service/ResourceMetadataService.php at line 69 and check how bearer_methods_supported is set. Change the advertised methods to match the supported Authorization header method, then verify /.well-known/oauth-protected-resource lists only header.

Written by the indexing model from the issue text.

Description

category::bug code priority::normal

Problem

/.well-known/oauth-protected-resource returns "bearer_methods_supported": ["header", "body", "query"] (modules/simple_oauth_server_metadata/src/Service/ResourceMetadataService.php, line 69). simple_oauth reads the access token only from the Authorization header.

A client that obeys the metadata can put the token in the URL. The request fails, and the token goes into the request logs of servers and proxies.

Expected Behavior

The metadata lists only header.

Steps to Reproduce

  1. Open /.well-known/oauth-protected-resource. The value of bearer_methods_supported contains header, body and query.
  2. Send GET /oauth/userinfo with the header Authorization: Bearer <access token>. The response is 200.
  3. Send GET /oauth/userinfo?access_token=<access token>. The response is 403.
  4. Send POST /oauth/userinfo with the form parameter access_token=<access token>. The response is 403.

Additional Context

Found on v2.1.1.

Dominant language
JavaScript
Stars
6
Forks
9
Avg merge
9h 41m
Merged PRs (30d)
15

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from e0ipso/simple_oauth_21

All issues in e0ipso/simple_oauth_21

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.