question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Improvement] Add params to Challenge

See original GitHub issue

At the moment, Challenge only contains the auth scheme name and realm. To provide authentication other than Basic, this is not enough. For instance, for Digest auth, there are various parameters which have to be parsed and processed.

I suggest to improve the Challenge class so that it contains not only auth scheme name and realm, but also a list of auth parameters, so that implementors don’t have to parse WWW-Authenticate again and can use okhttp’s Challenge instead, which would reduce redundancy. Logically, it sounds reasonable for me that a HTTP framework prepares authentication challenges in a way that they’re already usable by authenticators.

For a suggested layout of Challenge, please have a look at this HttpUtils.AuthScheme. It contains the auth scheme name, parsed unnamed parameters and parsed named parameters.

For a suggested parsing algorithm of WWW-Authenticate that generates such parameterized challenge instances, please see HttpUtils.parseWwwAuthenticate and its tests. It handles challenges without parameters, with RFC-compliant parameters (param=value), and with unnamed parameters (like used in Negotiate).

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
rfc2822commented, Aug 7, 2016

Yes, the dav4android methods are designed to be independent of the actual authentication method.

To implement my suggestion, I’d

  • enhance Challenge to also store unnamed and named parameters so that authenticators can use response.challanges() to get all required information without parsing headers itself;
  • change the List<Challenge> parseChallenges(Headers responseHeaders, String challengeHeader) method so that it extracts name and parameters from challengeHeader.
0reactions
swankjessecommented, Nov 3, 2018
Read more comments on GitHub >

github_iconTop Results From Across the Web

Query Optimization Techniques in SQL Server: Parameter ...
In this blog post we will walk you through one of the SQL Query Optimization Techniques in SQL Server - Parameter Sniffing.
Read more >
Query Parameters - Branch.io
Query parameters are a defined set of parameters attached to the end of a url. They are extensions of the URL that are...
Read more >
"up to three parameters" about function that in this challenge ...
Describe your problem and how to reproduce it: splice() can take up to three parameters? Well, we can go one step further with...
Read more >
Central Principles of the Continuous Improvement Model
The continuous improvement model is the idea that organizations should undertake incremental improvements to processes. Here are the seven ...
Read more >
10 Ways To Improve Your Creative Problem-Solving Skills
This is where you can use creative brainstorming or mind mapping to challenge the parameters of the problems and current solutions.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found