CredentialProvider
The interface nautilus calls to answer a verifiable-presentation request. One method.
nautilus opens the policy-server session itself (PolicySessionResolver):
it starts the verification, reads the session id and, after the presentation, checks that the
verifier accepted it. A provider does only the step in between: answering the openid4vp
request from a wallet. It is called only for a service whose SSIpolicy asks for
credentials; a service gated by addresses only needs no provider.
class implements CredentialProvider {
async (: CredentialChallenge): <void> {
.
.
.
. // the node that opened the session and will enforce it
. // the session the policy server opened
. // the openid4vp request to answer
}
}Resolve once the verifier has the presentation. Throw only when you could not present at all
(no matching credential, a rejected request): whether the verifier accepted it is checked by
nautilus afterwards, and a presentation it did not accept is a PolicyDeniedError.
When present() throws, nautilus asks the verifier's record of the session which policies
failed. If it names some, the caller gets a PolicyDeniedError with them and your error as its
cause; otherwise your error as you threw it. To skip that read when your provider failed
before the verifier saw anything, throw a CredentialPresentationError with a reason other
than 'verifier-rejected' (e.g. 'no-matching-credential'). Keep the session id, the openid4vp request and
the wallet's redirect URI out of your error's message and fields: the session id is a
credential, and apps log errors.
Nodes with the native SSI module
On a node with the native SSI module the challenge has protocol: 'oid4vp': redirectUri is
an OpenID4VP 1.0 request (openid4vp://), with the node's DCQL query in challenge.dcql, the
end of the presentation window in challenge.expiresAt and the node's verifier host in
challenge.verifierHost. nautilus checks the result with the node's ssiStatus. A provider
that speaks only one protocol throws a CredentialPresentationError with reason
'request-invalid' for the other.
An optional prepare(context) runs before nautilus opens the session (ssiInitiate). Throw
there when you can already tell you cannot present for context.consumerAddress (no wallet,
no login), and no session is opened. A session that is opened and never presented stays
pending at the node until its window closes, and the node allows a consumer only 5 pending
sessions by default.
Implementations
| Class | Use |
|---|---|
WalletApi2CredentialProvider | Nodes with the native SSI module: walt.id wallet-api2. |
WaltIdCredentialProvider | Nodes with a policy server: walt.id's v1 wallet API. |