- Request credential to Credential issuer and send the output Credential response
Note: Consumer of this library will be taking the responsibility of processing or parsing the credential for rendering or any other purpose as per requirement
Snapshot builds are available here.
implementation "io.mosip:inji-vci-client:0.1.0-SNAPSHOT"
ldp_Vcmso_mdoc
Refer here for the format constant
Request for credential from the providers (credential issuer), and receive the credential back.
val credentialResponse: CredentialResponse? = VCIClient().requestCredential(
issuerMetadata,
proof,
accessToken
)
| Name | Type | Description | Sample |
|---|---|---|---|
| issuerMetaData | IssuerMetaData | Data object of the issuer details | IssuerMetaData(credentialAudience, credentialEndpoint, downloadTimeout, credentialType, credentialFormat) |
| proofJwt | Proof | The proof used for making credential request. Supported proof types : JWT. | JWTProof(jwtValue) |
| accessToken | String | token issued by providers based on auth code | "" |
- Format:
ldp_vc
val issuerMetadata = IssuerMetaData(
CREDENTIAL_AUDIENCE,
CREDENTIAL_ENDPOINT,
DOWNLOAD_TIMEOUT,
CREDENTIAL_TYPE,
CredentialFormat.LDP_VC )
- Format:
mso_mdoc
val issuerMetadata = IssuerMetaData(
CREDENTIAL_AUDIENCE,
CREDENTIAL_ENDPOINT,
DOWNLOAD_TIMEOUT,
DOC_TYPE,
CLAIMS,
CredentialFormat.MSO_MDOC )
- DownloadFailedException is thrown when the credential issuer did not respond with credential response
- NetworkRequestTimeoutException is thrown when the request is timedout
An example app is added under /example folder which can be referenced for more details