initial ํ๋ซํผ ์๋น์ค๋ฅผ ์ฌ์ฉํ๊ธฐ ์ํ Java๊ธฐ๋ฐ์ Issuer, Verifier controller ์ Holder ์ฝ๋๋ฅผ ์ ๊ณตํฉ๋๋ค.
์ฉ๋์ ๋ฐ๋ผ Issuer ๋๋ Verifier ๋ฅผ ์ ํํ์ฌ ์์ฑํ๊ณ ํ ์คํธ ๋ฐ๋๋๋ค.
ํ ์คํธ๋ท: https://dev-console.myinitial.io
๊ธฐ๊ด ์์ฑํ๊ธฐ
- ๊ธฐ๊ด๋ช : Issuer๋ช (๋ณ๊ฒฝ๋์ง ์๋ ๊ฐ, ์ ์คํ๊ฒ ์์ฑํ์ธ์)
- ๋๋ฉ์ธ ์ ์ URL: https://issuer-controller.url (์์)
- Webhook URL: https://issuer-controller.url/webhooks (webhooks ๋ณ๊ฒฝํ์ง ๋ง์ธ์)
- Invitation URL: https://issuer-controller.url/invitation-url (invitation-url ๋ณ๊ฒฝํ์ง ๋ง์ธ์)
- ๊ธฐ๊ด ๊ตฌ๋ถ: Issuer, Verifier ๋์ ์ ํ
- AppType: Android, iOS ๋์ ์ ํ
- App ๋ ธ์ถ: ๋ฏธ์ฌ์ฉ (ํ์ ํ ์ฌ์ฉ)
- ๊ธฐ๊ด ์ฌ์ฉ: ๋ฏธ์ฌ์ฉ (ํ์ ํ ์ฌ์ฉ)
(์๋๋ ์ํ ๋ฐ๋ชจ๋ฅผ ์ํํ๊ธฐ ์ํจ์ผ๋ก, ์ถํ ์๋ก ์์ฑํ์ฌ ์ฌ์ฉํ์ธ์)
๊ฒ์ฆ๊ด๋ฆฌ - ๊ฒ์ฆ ์์ ์์ฑ - ์ฐธ์ฌ๊ธฐ๊ด๋ณ ์ฆ๋ช ์์ - ์ฆ๋ช ์์์ ๊ธฐ๋ฐ - ์ด๋์ ๋ชจ๋ฐ์ผ๊ฐ์ ์ฆ๋ช - ์์ฑํ๊ธฐ
- ๊ฒ์ฆ ์์๋ช : ๋ชจ๋ฐ์ผ ๊ฐ์ ์ฆ๋ช ๊ฒ์ฆ (์์)
- ์์ ์ค๋ช : ๋ชจ๋ฐ์ผ ๊ฐ์ ์ฆ๋ช ๊ฒ์ฆ (์์)
- ๊ฒ์ฆ ํญ๋ชฉ ์ ํ: person_name, mobile_num ๋ฑ
๊ฒ์ฆ๊ด๋ฆฌ - ๊ฒ์ฆ ์์ ๊ด๋ฆฌ - ๋ชจ๋ฐ์ผ ๊ฐ์ ์ฆ๋ช ๊ฒ์ฆ - ์์ธ ๋ณด๊ธฐ
- ๊ฒ์ฆ ์์ ID (
verifTplId
):0012d683-bdb0-4050-ac85-ae37e59bad09
(์์) ํ์ธ
๋ฐํ๊ด๋ฆฌ - ๋ฐํ ์์ ์์ฑ - ์ํ ํ์์ฆ๋ช (1.0)
- ์์์ค๋ช : ์ํ ์ฆ๋ช ์ (์์)
- ๊ธฐ๋ณธ ๋ฐํ ํญ๋ชฉ: ๋ณ๊ฒฝ ๋ถ๊ฐ (ํ์ ํ ์๋ก์ด ๊ธฐ๋ณธ์์ ์ถ๊ฐ ๊ฐ๋ฅ)
- ํ๊ธฐ์ง์์ฌ๋ถ: ์
๋ฐํ๊ด๋ฆฌ - ๋ฐํ ์์ ๊ด๋ฆฌ - ์ํ ํ์์ฆ๋ช (1.0)
- ์ฆ๋ช ์ ๋ฐํ ์ค์ : ๋ฐํ ์์
- ์ฆ๋ช
์ ID (
CredDefId
):Qr7Yo4sPs7cXiiVbEYwGsJ:3:CL:1618984624:1ee53b6d-7d8c-461e-910a-623302dc854a
(์์) ํ์ธ
๊ธฐ๊ด๊ด๋ฆฌ - ๊ธฐ๊ด ์ ๋ณด
Access Token
:514ac4f8-e0da-43c9-910d-4894279909b2
(์์) ํ์ธ- Webhook URL: https://issuer-controller.url/webhooks (์๋ฒ ์ฃผ์ ๋ฐ webhooks ๋ค์ ํ๋ฒ ํ์ธ)
๊ธฐ๊ด ์์ฑํ๊ธฐ
- ๊ธฐ๊ด๋ช : Verifier๋ช (๋ณ๊ฒฝ๋์ง ์๋ ๊ฐ, ์ ์คํ๊ฒ ์์ฑํ์ธ์)
- ๋๋ฉ์ธ ์ ์ URL: https://verifier-controller.url (์์)
- Webhook URL: https://verifier-controller.url/webhooks (webhooks ๋ณ๊ฒฝํ์ง ๋ง์ธ์)
- Invitation URL: https://verifier-controller.url/invitation-url (invitation-url ๋ณ๊ฒฝํ์ง ๋ง์ธ์)
- ๊ธฐ๊ด ๊ตฌ๋ถ: Verifier ์ ํ
- AppType: Android, iOS ๋์ ์ ํ
- App ๋ ธ์ถ: ๋ฏธ์ฌ์ฉ (ํ์ ํ ์ฌ์ฉ)
- ๊ธฐ๊ด ์ฌ์ฉ: ๋ฏธ์ฌ์ฉ (ํ์ ํ ์ฌ์ฉ)
(์๋๋ ์ํ ๋ฐ๋ชจ๋ฅผ ์ํํ๊ธฐ ์ํจ์ผ๋ก, ์ถํ ์๋ก ์์ฑํ์ฌ ์ฌ์ฉํ์ธ์)
๊ฒ์ฆ๊ด๋ฆฌ - ๊ฒ์ฆ ์์ ์์ฑ - ์ฐธ์ฌ๊ธฐ๊ด๋ณ ์ฆ๋ช ์์ - ์ฆ๋ช ์์์ ๊ธฐ๋ฐ - ์ด๋์ ๋ชจ๋ฐ์ผ๊ฐ์ ์ฆ๋ช - ์์ฑํ๊ธฐ
- ๊ฒ์ฆ ์์๋ช : ๋ชจ๋ฐ์ผ ๊ฐ์ ์ฆ๋ช ๊ฒ์ฆ (์์)
- ์์ ์ค๋ช : ๋ชจ๋ฐ์ผ ๊ฐ์ ์ฆ๋ช ๊ฒ์ฆ (์์)
- ๊ฒ์ฆ ํญ๋ชฉ ์ ํ: person_name, mobile_num ๋ฑ
๊ฒ์ฆ๊ด๋ฆฌ - ๊ฒ์ฆ ์์ ๊ด๋ฆฌ - ์ํ ๋ชจ๋ฐ์ผ ๊ฐ์ ์ฆ๋ช ๊ฒ์ฆ - ์์ธ ๋ณด๊ธฐ
- ๊ฒ์ฆ ์์ ID (
verifTplId
):0012d683-bdb0-4050-ac85-ae37e59bad09
(์์) ํ์ธ
๊ธฐ๊ด๊ด๋ฆฌ - ๊ธฐ๊ด ์ ๋ณด
Access Token
:514ac4f8-e0da-43c9-910d-4894279909b2
(์์) ํ์ธ- Webhook URL: https://verifier-controller.url/webhooks (์๋ฒ ์ฃผ์ ๋ฐ webhooks ๋ค์ ํ๋ฒ ํ์ธ)
src/main/resources/
server.port = 8040
agentApiUrl = https://dev-console.myinitial.io/agent/api ํน์ https://dev-console.myinitial.io/agent/v2/api (๊ธฐ๊ด ์ค์ ๊ฐ์์ ํ์ธ)
accessToken = issuer์ Access Token
credDefId = ์์ฑํ issuer์ CredDefId
verifTplId = ์์ฑํ issuer์ verifTplId
webViewUrl = https://issuer-controller.url/web-view/form.html
(Optional) Holder ์๊ฒ ๋ณด์ฌ์ค Web View ํ์ด์ง ์ฃผ์
server.port = 8040
agentApiUrl = https://dev-console.myinitial.io/agent/api ํน์ https://dev-console.myinitial.io/agent/v2/api (๊ธฐ๊ด ์ค์ ๊ฐ์์ ํ์ธ)
accessToken = verifier Access Token
verifTplId = ์์ฑํ issuer์ verifTplId
./gradlew issuer
๋๋ web view ๋ก์ง์ด ๋ค์ด๊ฐ ๋ฐ๋ชจ๋ฅผ ์ํํ๋ ค๋ ๊ฒฝ์ฐ ./gradlew issuer_webview
๋๋ revocation ๋ก์ง์ด ๋ค์ด๊ฐ ๋ฐ๋ชจ๋ฅผ ์ํํ๋ ค๋ ๊ฒฝ์ฐ ./gradlew issuer_revoke
./gradlew verifier
[GlobalService.java]initializeAfterStartup(61) : Controller is ready
src/main/java/com/sktelecom/initial/controller/holder/Application.java
String appMode = "dev"; // dev ๋๋ prod
String runType = "issue"; // issue ๋๋ verify
String tpIssuerInvitationUrl = "https://issuer-controller.url/invitation-url";
String tpCredDefId = "์์ฑํ issuer์ CredDefId
";
๋๋
String tpVerifierInvitationUrl = "https://verifier-controller.url/invitation-url";
์ด๊ธฐ๊ฐ์ devํ๊ฒฝ์ ๋ฏธ๋ฆฌ ์ค์ ๋์ด ์๋ test issuer ๋๋ test verifier ๋ก ์ค์ ๋์ด ์์ต๋๋ค.
๋ณ๊ฒฝ์์ด ์ฐ์ ํ
์คํธ ํด๋ณด์๋ฉด holder ๋์์ ํ์
ํ์ค ์ ์์ต๋๋ค.
./gradlew holder
2021-08-10 17:25:48 [INFO ] [GlobalService.java]handleEvent(97) : - Case (topic:issue_credential, state:credential_acked) -> credential issued successfully
2021-08-10 17:24:38 [INFO ] [GlobalService.java]handleEvent(77) : - Case (topic:present_proof, state:verified) -> getPresentationResult
2021-08-10 17:24:38 [INFO ] [GlobalService.java]getPresentationResult(283) : Requested Attribute - person_name: ๊น์ฆ๋ช
2021-08-10 17:24:38 [INFO ] [GlobalService.java]getPresentationResult(283) : Requested Attribute - mobile_num: 01023456789
Issuer๋ accessToken, credDefId, verifTplId, webhookUrl ์ด valid ํ ์ง ํ์ธ ํ๊ณ ๋๊ธฐํจ.
Holder๊ฐ https://issuer-controller.url/invitation-url ํธ์ถ๋ถํฐ ์์
Issuer API | Holder API | Issuer webhook (topic, state) | Holder webhook (topic, state) |
---|---|---|---|
POST /connections/create-invitation | |||
POST /connections/receive-invitation | connections, invitation | ||
connections, request | connections, request | ||
connections, response | connections, response | ||
connections, active | connections, active |
Holder๊ฐ (connections, active) ์์ ์ credential proposal์ ๋ณด๋
Issuer API | Holder API | Issuer webhook (topic, state, *msg_type) | Holder webhook (topic, state, *msg_type) |
---|---|---|---|
POST /issue-credential/send-proposal | issue_credential, proposal_received | issue_credential, proposal_sent | |
POST /present-proof/send-verification-request | present_proof, request_sent | present_proof, request_received | |
GET /present-proof/records/{presExId}/credentials | |||
POST /present-proof/records/{presExId}/send-presentation | present_proof, presentation_received | present_proof, presentation_sent | |
present_proof, verified | present_proof, presentation_acked |
Issuer๋ (issue_credential, proposal_received) ์์ ์ holder๊ฐ ๋ณด๋ธ credDefId๋ฅผ ํ์ธ ํ, ์ถํ issue ๊ณผ์ ์ ์ํด credExId๋ฅผ ์ ์ฅ ํด ๋
Issuer๋ (present_proof, verified) ์์ ์ webhook ๋ฉ์์ง๋ฅผ getPresentationResult ํ์ฌ ์๊ตฌํ ์ ๋ณด ํ๋
Issuer๊ฐ Presentation์ ์ ๋ณด๋ก ๋ฐํ ๊ฐ๋ฅํ ์ฆ๋ช ์๋ฅผ ํ์ ํ๊ธฐ ์ด๋ ค์ด ๊ฒฝ์ฐ, ์ถ๊ฐ ์ ๋ณด ํ๋์ ์ํจ
Issuer API | Holder API | Issuer webhook (topic, state, *msg_type) | Holder webhook (topic, state, *msg_type) |
---|---|---|---|
POST /connections/{conn_id}/send-message | basicmessages, received, *initial_web_view |
Holder๋ Issuer๊ฐ ์ ๊ณตํ web view ํ์ด์ง webViewUrl
๋ฅผ ๋ณด์ฌ์ฃผ๊ณ ์ฌ์ฉ์๊ฐ item ํ๋๋ฅผ ์ ํํจ
๋ณธ ๋ฐ๋ชจ์์๋ item ํ๋๋ฅผ ์ ํํ์ฌ Issuer์ POST https://issuer-controller.url/web-view/submit ๋ฅผ ํธ์ถํ๋ค๋ ๊ฐ์ ํ์ ๋์ํจ
Issuer๋ ๋ฐ์ ์ ๋ณด๋ฅผ ๊ธฐ๋ฐ์ผ๋ก DB๋ฅผ query ํ์ฌ ์ฆ๋ช ์๋ฅผ ์์ฑํ์ฌ ๋ฐ๊ธํจ
Issuer API | Holder API | Issuer webhook (topic, state) | Holder webhook (topic, state) |
---|---|---|---|
POST /issue-credential/records/{credExId}/send-offer | issue_credential, offer_sent | issue_credential, offer_received | |
POST /issue-credential/records/{credExId}/send-request | issue_credential, request_received | issue_credential, request_sent | |
issue_credential, credential_issued | issue_credential, credential_received | ||
issuer_cred_rev, issued | |||
issue_credential, credential_acked | issue_credential, credential_acked |
์ถํ ๋ฐ๊ธํ ์ฆ๋ช
์๋ฅผ ํ๊ธฐ(revocation)ํ๊ธฐ ์ํด์๋,
Issuer๋ (issue_credential, credential_acked) ์์ ์ webhook ๋ฉ์์ง๋ฅผ ํ์ธํ์ฌ credential_exchange_id ๋ฅผ DB์ ๊ธฐ๋กํด ๋์ด์ผ ํจ
Issuer API | Holder API | Issuer webhook (topic, state) | Holder webhook (topic, state) |
---|---|---|---|
POST /revocation/revoke | issuer_cred_rev, revoked |
Revoke๋ credential์ Issuer๊ฐ (present_proof, verified) ์์ ์, webhook ๋ฉ์์ง๋ฅผ getPresentationResult ํ๋ ๊ณผ์ ์์ verified ๊ฐ false ์
Verifier๋ accessToken, credDefId, verifTplId, webhookUrl ์ด valid ํ ์ง ํ์ธ ํ๊ณ ๋๊ธฐํจ.
Holder๊ฐ https://verifier-controller.url/invitation-url ํธ์ถ๋ถํฐ ์์
Issuer API | Holder API | Issuer webhook (topic, state) | Holder webhook (topic, state) |
---|---|---|---|
POST /connections/create-invitation | |||
POST /connections/receive-invitation | connections, invitation | ||
connections, request | connections, request | ||
connections, response | connections, response | ||
connections, active | connections, active |
Holder๊ฐ (connections, active) ์์ ์ presentation proposal์ ๋ณด๋
Issuer API | Holder API | Issuer webhook (topic, state, *msg_type) | Holder webhook (topic, state, *msg_type) |
---|---|---|---|
POST /present-proof/send-proposal | present_proof, proposal_received | present_proof, proposal_sent | |
POST /present-proof/send-verification-request | present_proof, request_sent | present_proof, request_received | |
GET /present-proof/records/{presExId}/credentials | |||
POST /present-proof/records/{presExId}/send-presentation | present_proof, presentation_received | present_proof, presentation_sent | |
present_proof, verified | present_proof, presentation_acked |
Verifier๋ (present_proof, verified) ์์ ์ webhook ๋ฉ์์ง๋ฅผ getPresentationResult ํ์ฌ ์๊ตฌํ ์ ๋ณด ํ๋
๋ฑ๊ฒฝ ํด์ผ ํ ํญ๋ชฉ๋ง ์ ๋ฆฌ
์์ฉ: https://console.myinitial.io
production ์๋ก ์์ฑ
production ์๋ก ์์ฑ
agentApiUrl = https://console.myinitial.io/agent/api (๊ณ ์ )
agentApiUrl = https://console.myinitial.io/agent/api (๊ณ ์ )
./gradlew issuer_prod
./gradlew verifier_prod