Send application_type during Dynamic Client Registration (SEP-837) (#2930)
This commit is contained in:
parent
60f37e9d7c
commit
cf41441e44
1 changed files with 35 additions and 38 deletions
|
|
@ -1,6 +1,7 @@
|
|||
"""Tests for refactored OAuth client authentication implementation."""
|
||||
|
||||
import base64
|
||||
import json
|
||||
import time
|
||||
from unittest import mock
|
||||
from urllib.parse import parse_qs, quote, unquote, urlparse
|
||||
|
|
@ -1049,6 +1050,21 @@ class TestCreateClientRegistrationRequest:
|
|||
assert request.method == "POST"
|
||||
|
||||
|
||||
def test_registration_request_sends_application_type():
|
||||
"""SEP-837: the DCR body carries application_type, defaulting to native and overridable."""
|
||||
redirect_uris: list[AnyUrl] = [AnyUrl("http://localhost:3000/callback")]
|
||||
|
||||
default_request = create_client_registration_request(
|
||||
None, OAuthClientMetadata(redirect_uris=redirect_uris), "https://auth.example.com"
|
||||
)
|
||||
assert json.loads(default_request.content)["application_type"] == "native"
|
||||
|
||||
web_request = create_client_registration_request(
|
||||
None, OAuthClientMetadata(redirect_uris=redirect_uris, application_type="web"), "https://auth.example.com"
|
||||
)
|
||||
assert json.loads(web_request.content)["application_type"] == "web"
|
||||
|
||||
|
||||
class TestAuthFlow:
|
||||
"""Test the auth flow in httpx."""
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue