microsoft / microsoft/azure-devops-python-api

AzureDevOpsAuthenticationError: The requested resource requires user authentication: https://dev.azure.com/myorg/_apis

Đang mở
#399 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
Python
Star
684
Fork
218
Merge trung bình
8 ngày 10 giờ
Pull request đã merge (30 ngày)
1

Mô tả

I followed the sample code:

        credentials = BasicAuthentication(username=user, password=pat)
        self.connection = Connection(base_url="https://dev.azure.com/myorg/", creds=credentials)
        testClient = self.connection.clients.get_core_client()

But I get exception. Did I miss something?

   testClient = self.connection.clients.get_core_client()
  File "/Users/runner/hostedtoolcache/Python/3.10.0/x64/lib/python3.10/site-packages/azure/devops/released/client_factory.py", line 44, in get_core_client
    return self._connection.get_client('azure.devops.released.core.core_client.CoreClient')
  File "/Users/runner/hostedtoolcache/Python/3.10.0/x64/lib/python3.10/site-packages/azure/devops/connection.py", line 45, in get_client
    self._client_cache[client_type] = self._get_client_instance(client_class)
  File "/Users/runner/hostedtoolcache/Python/3.10.0/x64/lib/python3.10/site-packages/azure/devops/connection.py", line 58, in _get_client_instance
    url = self._get_url_for_client_instance(client_class)
  File "/Users/runner/hostedtoolcache/Python/3.10.0/x64/lib/python3.10/site-packages/azure/devops/connection.py", line 70, in _get_url_for_client_instance
    resource_areas = self._get_resource_areas()
  File "/Users/runner/hostedtoolcache/Python/3.10.0/x64/lib/python3.10/site-packages/azure/devops/connection.py", line 120, in _get_resource_areas
    self._resource_areas = location_client.get_resource_areas()
  File "/Users/runner/hostedtoolcache/Python/3.10.0/x64/lib/python3.10/site-packages/azure/devops/v5_1/location/location_client.py", line 104, in get_resource_areas
    response = self._send(http_method='GET',
  File "/Users/runner/hostedtoolcache/Python/3.10.0/x64/lib/python3.10/site-packages/azure/devops/client.py", line 74, in _send
    request = self._create_request_message(http_method=http_method,
  File "/Users/runner/hostedtoolcache/Python/3.10.0/x64/lib/python3.10/site-packages/azure/devops/client.py", line 119, in _create_request_message
    location = self._get_organization_resource_location(location_id)
  File "/Users/runner/hostedtoolcache/Python/3.10.0/x64/lib/python3.10/site-packages/azure/devops/client.py", line 160, in _get_organization_resource_location
    return self._get_resource_location(self.normalized_url, location_id)
  File "/Users/runner/hostedtoolcache/Python/3.10.0/x64/lib/python3.10/site-packages/azure/devops/client.py", line 172, in _get_resource_location
    Client._locations_cache[url] = self._get_resource_locations(url, all_host_types=False)
  File "/Users/runner/hostedtoolcache/Python/3.10.0/x64/lib/python3.10/site-packages/azure/devops/client.py", line 208, in _get_resource_locations
    response = self._send_request(request, headers=headers)
  File "/Users/runner/hostedtoolcache/Python/3.10.0/x64/lib/python3.10/site-packages/azure/devops/client.py", line 68, in _send_request
    self._handle_error(request, response)
  File "/Users/runner/hostedtoolcache/Python/3.10.0/x64/lib/python3.10/site-packages/azure/devops/client.py", line 290, in _handle_error
    raise AzureDevOpsAuthenticationError(full_message_format.format(error_message=error_message,

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu với mẫu Connection(...) và BasicAuthentication, sau đó lần theo get_core_client qua azure/devops/connection.py và azure/devops/client.py đến yêu cầu resource-area được hiển thị trong stack trace. Tái hiện lỗi xác thực và xác định cấu hình hoặc chi tiết endpoint còn thiếu; hoàn thành khi mẫu xác thực thành công hoặc bản sửa cần thiết được ghi lại.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
azure, python
Lĩnh vực
api, authentication
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
30/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.