Skip to content
This repository was archived by the owner on Jun 23, 2023. It is now read-only.
This repository was archived by the owner on Jun 23, 2023. It is now read-only.

Registration api (read) #95

@peppelinux

Description

@peppelinux

During the coverage of django-oidc-op, with pure integration tests, I got this exception when I try to test registration_read endpoint.

[(INFO)] [2021-06-10 08:35:11,908] Request at the "registration" endpoint [oidc_provider.views.service_endpoint:169]
[(DEBUG)] [2021-06-10 08:35:11,939] new_func request GET: <QueryDict: {'client_id': ['VWDTEQ5A5Lrm-L2gZSXgAw']}> - - Authorization Header: _q__lkUQbiv8hSHh5adxK_sL6B1CD4PVpTRrrOxF5O4 [oidc_provider.decorators.debug_request:21]
[(INFO)] [2021-06-10 08:35:11,947] Request at the "registration_read" endpoint [oidc_provider.views.service_endpoint:169]
[(ERROR)] [2021-06-10 08:35:11,949] Internal Server Error: /oidcop/registration_read [django.request.log_response:224]
Traceback (most recent call last):
  File "~/DEV/IdentityPython/OIDC/env/lib/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "~/DEV/IdentityPython/OIDC/env/lib/python3.8/site-packages/django/core/handlers/base.py", line 179, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "~/DEV/IdentityPython/OIDC/env/lib/python3.8/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
    return view_func(*args, **kwargs)
  File "~/DEV/IdentityPython/OIDC/django-oidc-op/oidc_provider/tests/example/oidc_provider/decorators.py", line 54, in new_func
    return func_to_decorate(*original_args, **original_kwargs)
  File "~/DEV/IdentityPython/OIDC/django-oidc-op/oidc_provider/tests/example/oidc_provider/decorators.py", line 67, in new_func
    return func_to_decorate(*original_args, **original_kwargs)
  File "~/DEV/IdentityPython/OIDC/django-oidc-op/oidc_provider/tests/example/oidc_provider/views.py", line 243, in registration_read
    return service_endpoint(
  File "~/DEV/IdentityPython/OIDC/django-oidc-op/oidc_provider/tests/example/oidc_provider/views.py", line 173, in service_endpoint
    req_args = endpoint.parse_request(data, http_info=http_info)
  File "~/DEV/IdentityPython/OIDC/env/lib/python3.8/site-packages/oidcop/endpoint.py", line 178, in parse_request
    auth_info = self.client_authentication(req, http_info, endpoint=self, **kwargs)
  File "~/DEV/IdentityPython/OIDC/env/lib/python3.8/site-packages/oidcop/endpoint.py", line 231, in client_authentication
    raise UnAuthorizedClient("Authorization failed")
oidcop.exception.UnAuthorizedClient: Authorization failed

This is the test I'm using
https://github.com/peppelinux/django-oidc-op/blob/91e2c53219472b33de110165e447fad4c2268fe0/oidc_provider/tests/test_03_rp_flow.py#L79

It seems to me that the client registration_access_token have not been recognized as valid by client_authn.verify_client().
Digging in the oidc-op unit tests I found this:

_resp["response_args"]["registration_access_token"]

This test meks me aware of what parameters (and authz bearer token) to use, despite this the integration test fails, am I wrong or do we have a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions