panva / openid-client

OAuth 2 / OpenID Connect Client API for JavaScript Runtimes
MIT License
1.83k stars 392 forks source link

Documentation Additions and Clarifications #244

Closed BatBrain closed 4 years ago

BatBrain commented 4 years ago

Instructions unclear, packets stuck in toaster.

panva commented 4 years ago
  • If possible a complete code example of both client and issuer standard flow would be very helpful.

Quick start in the main readme is included and includes issuer discovery, further examples use the same variable names. I'm not going to include a full example because then i'd have to pick a web framework, session middleware, etc and people just do copy paste programming using what i only show as an example without giving it a further thought. And then users of other frameworks would ask for more examples. This is framework agnostic module, its a swiss army knife set of functions that follows the specs.

  • max_age and a number of other meta fields could use some clarification beyond just the data type it expects. For examples is max_age default in seconds, if its not default, would that be set by the issuer?

I do not intend to document what is described the specs - e.g. you mention max_age, it is well defined by OIDC Core. Same goes for all IANA defined client metadata properties - the library doesn't support anything proprietary.

  • An example for each function with params for each section would also be very helpful. Documentation is great for debugging, but in certain areas going from
function(param1, param2[], param3) 
param1: String
Param2: Array
Param3: Number

To properly formatted code isn't as friction-less as it could be.

Again, the docs explain well what parameters are if that's not a clearly protocol-related property - such as state, nonce... I don't feel like i need to explain those.

  • Mentioned support for Passport at top of documentation, but then link to passport landing page, which is rather confusing

Instructions unclear, packets stuck in toaster.

Would you prefer this link instead?