http.oidc.new

http.oidc

new(cfg) -> client, err

Create a relying-party client

keyrequiredmeaning
issueryeshttps, or http on a loopback host; no query, no fragment
client_idyesthe registered id
client_secretyesthe registered secret; the client is confidential
redirect_uriyesthe callback the IdP sends the code to
scopesnolist, default { "openid" }; openid is added when absent
algsnothe ID token allowlist, default { "EdDSA" }
leewaynoseconds of slack on the time claims, default 30
timeoutnoseconds per request at the IdP, default 5
httpnohttp.request options every call carries: the TLS ones
clocknofunction() -> 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.