Skip to content

Commit

Permalink
Change introspect call to send token in body and query
Browse files Browse the repository at this point in the history
  • Loading branch information
tjeerddie committed Sep 20, 2023
1 parent 090cc3f commit d02361a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions oauth2_lib/fastapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ async def introspect_token(self, async_request: AsyncClient, token: str) -> OIDC
endpoint = self.openid_config.introspect_endpoint or self.openid_config.introspection_endpoint
response = await async_request.post(
endpoint,
params={"token": token},
data={"token": token},
auth=BasicAuth(self.resource_server_id, self.resource_server_secret),
headers={"Content-Type": "application/x-www-form-urlencoded"},
Expand Down
2 changes: 2 additions & 0 deletions tests/test_fastapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ async def test_introspect_token(make_mock_async_client):
discovery["introspect_endpoint"],
auth=MockBasicAuth("id", "secret"),
headers={"Content-Type": "application/x-www-form-urlencoded"},
params={"token": access_token},
data={"token": access_token},
)

Expand Down Expand Up @@ -215,6 +216,7 @@ async def mock_request(*args, **kwargs):
discovery["introspect_endpoint"],
auth=MockBasicAuth("id", "secret"),
headers={"Content-Type": "application/x-www-form-urlencoded"},
params={"token": access_token},
data={"token": access_token},
)

Expand Down

0 comments on commit d02361a

Please sign in to comment.