Skip to content

Commit e48bee0

Browse files
[INJIMOB-3147] move common readme content to root level readme (#60)
Signed-off-by: KiruthikaJeyashankar <[email protected]>
1 parent 8a9b9a2 commit e48bee0

File tree

3 files changed

+77
-71
lines changed

3 files changed

+77
-71
lines changed

README.md

Lines changed: 74 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,74 @@
1-
# inji-openid4vp
2-
Description: Implementation of OpenID4VP protocols in Kotlin and JS
1+
# INJI-OpenID4VP
2+
3+
Description: Implementation of OpenID for Verifiable Presentations - draft 21 specifications in Kotlin
4+
5+
# Supported features
6+
7+
| Feature | Supported values |
8+
|------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
9+
| Device flow | cross device flow |
10+
| Client id scheme | `pre-registered`, `redirect_uri`, `did` |
11+
| Signed authorization request verification algorithms | ed25519 |
12+
| Obtaining authorization request | By value, By reference ( via `request_uri` method) <br> _[Note: Authorization request by value is not supported for the did client ID scheme, as it requires a signed request. Instead, a Request URI should be used to fetch the signed authorization request ([reference](https://openid.net/specs/openid-4-verifiable-presentations-1_0-21.html#section-3.2))]_ |
13+
| Obtaining presentation definition in authorization request | By value, By reference (via `presentation_definition_uri`) |
14+
| Authorization Response mode | `direct_post` |
15+
| Authorization Response type | `vp_token` |
16+
| Supported Verifiable Presentations for Online sharing | Credential format: `ldp_vc` | | |
17+
18+
19+
20+
## Specifications supported
21+
- The implementation follows OpenID for Verifiable Presentations - draft 21. [Specification](https://openid.net/specs/openid-4-verifiable-presentations-1_0-21.html).
22+
- Below are the fields we expect in the authorization request based on the client id scheme,
23+
- Client_id_scheme is **_pre-registered_**
24+
* client_id
25+
* client_id_scheme
26+
* presentation_definition/presentation_definition_uri
27+
* response_type
28+
* response_mode
29+
* nonce
30+
* state
31+
* response_uri
32+
* client_metadata (Optional)
33+
34+
- Client_id_scheme is **_redirect_uri_**
35+
* client_id
36+
* client_id_scheme
37+
* presentation_definition/presentation_definition_uri
38+
* response_type
39+
* nonce
40+
* state
41+
* redirect_uri
42+
* client_metadata (Optional)
43+
44+
- **_request uri_** is also supported as part of this version.
45+
- When request_uri is passed as part of the authorization request, below are the fields we expect in the authorization request,
46+
* client_id
47+
* client_id_scheme
48+
* request_uri
49+
* request_uri_method
50+
51+
- The request uri can return either a jwt token/encoded if it is a jwt the signature is verified as mentioned in the specification.
52+
- The client id and client id scheme from the authorization request and the client id and client id scheme received from the response of the request uri should be same.
53+
- VC format supported is Ldp Vc as of now.
54+
55+
**Note** : The pre-registered client id scheme validation can be toggled on/off based on the optional boolean which you can pass to the authenticateVerifier methods shouldValidateClient parameter. This is false by default.
56+
## Functionalities
57+
58+
- Decode and parse the Verifier's encoded Authorization Request received from the Wallet.
59+
- Authenticates the Verifier using the received clientId and returns the valid Presentation Definition to the Wallet.
60+
- Receives the list of verifiable credentials(VC's) from the Wallet which are selected by the Wallet end user based on the credentials requested as part of Verifier Authorization request.
61+
- Constructs the verifiable presentation and send it to wallet for generating Json Web Signature (JWS).
62+
- Receives the signed Verifiable presentation and sends a POST request with generated vp_token and presentation_submission to the Verifier response_uri endpoint.
63+
64+
**Note** : Fetching Verifiable Credentials by passing [Scope](https://openid.net/specs/openid-4-verifiable-presentations-1_0.html#name-using-scope-parameter-to-re) param in Authorization Request is not supported by this library.
65+
66+
## Library implementations available in:
67+
68+
This library is officially supported and available in both Kotlin and Swift, ensuring seamless integration across Android and iOS platforms. The references for both implementations are provided below:
69+
* [Kotlin](./kotlin/openID4VP/README.md)
70+
* [Swift](https://github.com/mosip/inji-openid4vp-ios-swift)
71+
72+
##### The below diagram shows the interactions between Wallet, Verifier and OpenID4VP library
73+
74+
<figure><img src="assets/sequence-diagram.png" alt=""><figcaption></figcaption></figure>
File renamed without changes.

kotlin/openID4VP/README.md

Lines changed: 3 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,11 @@
11
# INJI-OpenID4VP
22

3-
Description: Implementation of OpenID for Verifiable Presentations - draft 21 specifications in Kotlin
4-
5-
# Supported features
6-
7-
| Feature | Supported values |
8-
|------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
9-
| Device flow | cross device flow |
10-
| Client id scheme | `pre-registered`, `redirect_uri`, `did` |
11-
| Signed authorization request verification algorithms | ed25519 |
12-
| Obtaining authorization request | By value, By reference ( via `request_uri` method) <br> _[Note: Authorization request by value is not supported for the did client ID scheme, as it requires a signed request. Instead, a Request URI should be used to fetch the signed authorization request ([reference](https://openid.net/specs/openid-4-verifiable-presentations-1_0-21.html#section-3.2))]_ |
13-
| Obtaining presentation definition in authorization request | By value, By reference (via `presentation_definition_uri`) |
14-
| Authorization Response mode | `direct_post` |
15-
| Authorization Response type | `vp_token` |
16-
17-
18-
19-
## Specifications supported
20-
- The implementation follows OpenID for Verifiable Presentations - draft 21. [Specification](https://openid.net/specs/openid-4-verifiable-presentations-1_0-21.html).
21-
- Below are the fields we expect in the authorization request based on the client id scheme,
22-
- Client_id_scheme is **_pre-registered_**
23-
* client_id
24-
* client_id_scheme
25-
* presentation_definition/presentation_definition_uri
26-
* response_type
27-
* response_mode
28-
* nonce
29-
* state
30-
* response_uri
31-
* client_metadata (Optional)
32-
33-
- Client_id_scheme is **_redirect_uri_**
34-
* client_id
35-
* client_id_scheme
36-
* presentation_definition/presentation_definition_uri
37-
* response_type
38-
* nonce
39-
* state
40-
* redirect_uri
41-
* client_metadata (Optional)
42-
43-
- **_Request Uri_** is also supported as part of this version.
44-
- When request_uri is passed as part of the authorization request, below are the fields we expect in the authorization request,
45-
* client_id
46-
* client_id_scheme
47-
* request_uri
48-
* request_uri_method
49-
50-
- The request uri can return either a jwt token/encoded if it is a jwt the signature is verified as mentioned in the specification.
51-
- The client id and client id scheme from the authorization request and the client id and client id scheme received from the response of the request uri should be same.
52-
- VC format supported is Ldp Vc as of now.
53-
54-
**Note** : The pre-registered client id scheme validation can be toggled on/off based on the optional boolean which you can pass to the authenticateVerifier methods shouldValidateClient parameter. This is false by default.
55-
## Functionalities
56-
57-
- Decode and parse the Verifier's encoded Authorization Request received from the Wallet.
58-
- Authenticates the Verifier using the received clientId and returns the valid Presentation Definition to the Wallet.
59-
- Receives the list of verifiable credentials(VC's) from the Wallet which are selected by the Wallet end user based on the credentials requested as part of Verifier Authorization request.
60-
- Constructs the verifiable presentation and send it to wallet for generating Json Web Signature (JWS).
61-
- Receives the signed Verifiable presentation and sends a POST request with generated vp_token and presentation_submission to the Verifier response_uri endpoint.
62-
63-
**Note** : Fetching Verifiable Credentials by passing [Scope](https://openid.net/specs/openid-4-verifiable-presentations-1_0.html#name-using-scope-parameter-to-re) param in Authorization Request is not supported by this library.
64-
653
## Installation
664

675
Snapshot builds are available -
686

697
```
70-
implementation "io.mosip:inji-openid4vp:0.1.0-SNAPSHOT"
8+
implementation "io.mosip:inji-openid4vp:0.2.0-SNAPSHOT"
719
```
7210

7311
## Create instance of OpenID4VP library to invoke it's methods
@@ -83,7 +21,7 @@ val openID4VP = OpenID4VP()
8321
- Returns the validated Authorization request object.
8422

8523
```
86-
val authenticationResponse = openID4VP.authenticateVerifier(encodedAuthenticationRequest: String, trustedVerifierJSON: List<Verifier>, shouldValidateClient: Bool)
24+
val authenticationResponse = openID4VP.authenticateVerifier(urlEncodedAuthorizationRequest: String, trustedVerifierJSON: List<Verifier>, shouldValidateClient: Bool)
8725
```
8826

8927
###### Parameters
@@ -172,8 +110,4 @@ This method will also notify the Verifier about the error by sending it to the r
172110
###### Exceptions
173111

174112
1. InterruptedIOException is thrown if the connection is timed out when network call is made.
175-
2. NetworkRequestFailed exception is thrown when there is any other exception occurred when sending the response over http post request.
176-
177-
##### The below diagram shows the interactions between Wallet, Verifier and OpenID4VP library
178-
179-
<figure><img src="assets/sequence-diagram.png" alt=""><figcaption></figcaption></figure>
113+
2. NetworkRequestFailed exception is thrown when there is any other exception occurred when sending the response over http post request.

0 commit comments

Comments
 (0)