WordPress / WordPress/Requests

How to perform Digest Authentication With Requests

Open
#245 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
3.6k
Forks
500
Avg merge
2d 21h
Merged PRs (30d)
5

Description

$user = 'myusername';
$pass = 'mypass';
$BaseApiUrl     = 'myurl';

$headers = array('Accept' => 'application/json');
$options = array('auth' => new Requests_Auth_Basic(array($user, $pass)));
$request = Requests::get($BaseApiUrl, $headers, $options);
var_dump($request->status_code);
var_dump($request->body);

This is my code it gives error
int(401) string(28) "HTTP Digest: Access denied. "

You have
Basic/Digest Authentication

please provide step for Digest Authentication

Contributor guide

Open the contributing guide

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.

Research direction

Review the issue's PHP example, especially Requests_Auth_Basic and the Requests::get call, and inspect the repository's existing authentication documentation or examples. Clarify whether Digest Authentication is supported and document the correct usage if the project provides it; done means a newcomer can follow the documented steps without receiving the reported 401 response.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
authentication, backend
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.