Skip to content
마지막 작성자: hyejung-song
최근 업데이트: 25. 7. 8. 오후 1:09

WebToApp 구현 ​

모바일 신분증 WebToApp 연동은 AppToApp의 direct mode 방식과 동일하게 SP 서버로 VP를 제출하는 구조예요. VP 제출 확인 방식은 아래 두 가지 중 선택할 수 있어요.

  • 자동 확인: 서비스 웹페이지에서 SP서버로 응답을 주기적으로 확인
  • 수동 확인: 모바일 신분증 앱 종료 후 ‘인증 확인’ 버튼을 눌러 결과 확인

1. 호출 방식 ​

Android ​

  • 방식 1 (URL Scheme)
html
window.location.href =
'mobileid://verify?data_type=byte&data=m200Base64&clientScheme=';
  • 방식 2 (Intent 방식)
html
<a
  href="intent://verify?data_type=byte&data=m200Base64#Intent;scheme=mobileid;action=android.intent.action.VIEW;category=android.intent.category.BROWSABLE;package=kr.go.mobileid;end"
>
  신분증 앱 실행
</a>
파라미터설명
data_type선택, string 또는 byte 가능
data필수, Base64 인코딩된 M200 메시지
clientScheme선택, 신분증 앱 종료 후 돌아올 URL Scheme

Intent 방식은 앱 미설치 시 자동으로 플레이스토어 이동, URL Scheme 방식은 그렇지 않아요.


iOS ​

  • 방식 1 (URL Scheme)
javascript
window.location.href =
  "MobileID://verify?mode=direct&data=<BASE64_ENCODED_M200>&clientScheme=";
  • 방식 2 (Universal Link)
    → 3.3 Universal Link 방식 참조
파라미터설명
mode필수, direct 또는 indirect
data필수, Base64 인코딩된 M200 메시지
clientScheme필수, 앱 종료 후 호출할 URL Scheme. 없을 경우 공백

2. 미설치 시 예외처리 방안 ​

URL Scheme 방식으로 신분증 앱 호출 시 앱이 미설치된 경우, 대응이 어렵기 때문에 별도 예외처리 필요해요.

  • 대응 방안:

    • 일정 시간 내 앱 응답 없으면 안내문구 표시
    • clientScheme 설정을 통해 결과 확인 로직 분리 구현
  • 예시: 간편인증 인증 진행화면 App2App 연동 흐름도

3. 에러코드 ​

아래는 VP 제출 시 발생할 수 있는 주요 에러코드 목록이에요:

코드이름설명
20001Unexpected message formatJSON 형식이 아님
20002Missing mandatory item필수 항목 누락
20100Invalid data유효하지 않은 데이터
20101Invalid resultresult 값이 true/false 아님
20102Encoding error인코딩 오류
20103Mismatching trxcode거래코드 불일치
20104Unsupported image type이미지 타입 미지원
20201Message sequence error메시지 순서 오류
20202Timeout error유효시간 초과
20203Unknown disconnect앱 강제 종료 등
20300Invalid profile data프로필 데이터 오류
20301VC not exists발급된 VC 없음
20302No VC for allowed issuers해당 발급자 VC 없음
20303Missing mandatory item in profile프로필 내 필수 항목 누락
20304Missing nonce in profile프로필에 nonce 없음
20305Missing proof in profile프로필에 proof 없음
20306Profile signature validation fail서명 검증 실패
20307Fail to get DID documentDID 문서 조회 실패
20308Fail to get VC StatusVC 상태 업데이트 실패
20401ZKP error 1영지식 정보 검색 실패
20402ZKP error 2나이 조건 불일치
20403ZKP error 3Credential schema 조회 실패
20501Fail to get profile프로필 조회 실패
20502Fail to get image이미지 조회 실패
20503Fail to submit VPVP 제출 실패
20511Fail to get sig-profile전자서명 프로필 실패
20513Fail to submit sig-vp전자서명 VP 제출 실패
20601VP proof failVP 생성 실패
20602Make signature fail서명 생성 실패
20701BLE incorrect passwordBLE 비밀번호 오류
20901Cancel by user사용자 취소
20903Transmit size exceeded전송 사이즈 초과
90001User authentication fail사용자 인증 실패
90002Invalid app version앱 버전 오류
99999Unknown error알 수 없는 오류