new(
cfg) ->client,err
Create a relying-party client
| key | required | meaning |
|---|---|---|
issuer | yes | https, or http on a loopback host; no query, no fragment |
client_id | yes | the registered id |
client_secret | yes | the registered secret; the client is confidential |
redirect_uri | yes | the callback the IdP sends the code to |
scopes | no | list, default { "openid" }; openid is added when absent |
algs | no | the ID token allowlist, default { "EdDSA" } |
leeway | no | seconds of slack on the time claims, default 30 |
timeout | no | seconds per request at the IdP, default 5 |
http | no | http.request options every call carries: the TLS ones |
clock | no | function() -> seconds, default os.time |
The config is data and a bad one returns nil, err. http on a host
that is not loopback is refused: the issuer is the trust anchor of
every check that follows.