{"id":38607029,"url":"https://github.com/ic4j/ic4j-internetidentity","last_synced_at":"2026-01-17T08:39:22.055Z","repository":{"id":128477838,"uuid":"494206914","full_name":"ic4j/ic4j-internetidentity","owner":"ic4j","description":"Library for access to the IC Internet Identity","archived":false,"fork":false,"pushed_at":"2025-05-23T18:01:58.000Z","size":131,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-23T19:18:16.664Z","etag":null,"topics":["android","dfinity","icp","java"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ic4j.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-05-19T19:39:25.000Z","updated_at":"2024-09-17T22:59:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"47c80d14-49fa-4e55-9185-416e978f6c5e","html_url":"https://github.com/ic4j/ic4j-internetidentity","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ic4j/ic4j-internetidentity","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ic4j%2Fic4j-internetidentity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ic4j%2Fic4j-internetidentity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ic4j%2Fic4j-internetidentity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ic4j%2Fic4j-internetidentity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ic4j","download_url":"https://codeload.github.com/ic4j/ic4j-internetidentity/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ic4j%2Fic4j-internetidentity/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28504370,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T06:57:29.758Z","status":"ssl_error","status_checked_at":"2026-01-17T06:56:03.931Z","response_time":85,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","dfinity","icp","java"],"created_at":"2026-01-17T08:39:21.327Z","updated_at":"2026-01-17T08:39:22.047Z","avatar_url":"https://github.com/ic4j.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Internet Identity Java Service \n\nProviding an implementation of ICP Internet Identity Service, this Java library enables developers to register new users, add or remove devices, and authenticate client applications on the Internet Computer.  More information can be found in the Internet Identity specification on the GitHub repository at \u003ca href=\"https://github.com/dfinity/internet-identity/blob/main/docs/internet-identity-spec.adoc#the-internet-identity-specification\"\u003ehttps://github.com/dfinity/internet-identity/blob/main/docs/internet-identity-spec.adoc#the-internet-identity-specification\u003c/a\u003e.\nTo test the Internet Identity Service locally, install the local Internet Identity dApp and configure custom Java properties with the ii.location and ii.canister values pointing to the local instance. \n\n\u003ca href=\"https://github.com/dfinity/internet-identity/tree/main/demos/using-dev-build\"\u003ehttps://github.com/dfinity/internet-identity/tree/main/demos/using-dev-build\u003c/a\u003e\n\n\nTo use Internet Identity Service create InternetIdentityService object. Define your own properties if you want to use local instance of the service. \n\n```\nSecurity.addProvider(new BouncyCastleProvider());\n\t\t\nBasicIdentity identity = BasicIdentity.fromPEMFile(Paths.get(pemFile));\n\t\t\nProperties env = InternetIdentityService.getIIProperties();\n\nString iiLocation = env.getProperty(\"ii.location\");\n\t\t\nReplicaTransport transport = ReplicaApacheHttpTransport.create(iiLocation);\n\nAgent agent = new AgentBuilder().transport(transport).identity(identity).build();\n\nInternetIdentityService InternetIdentityService = InternetIdentityService.create(agent, env);\n\n```\nThen call Internet Identity Service methods. Combine methods to create flow defined in the specification. \n\n\u003ca href=\"https://github.com/dfinity/internet-identity/blob/main/docs/internet-identity-spec.adoc#flows\"\u003ehttps://github.com/dfinity/internet-identity/blob/main/docs/internet-identity-spec.adoc#flows\u003c/a\u003e\n\n```\nbyte[] sessionKey = identity.derEncodedPublickey;\n\nCompletableFuture\u003cChallenge\u003e challengeResponse = internetIdentityService.createChallenge();\nChallenge challenge = challengeResponse.get();\n\n// convert byte[] to a BufferedImage\nBufferedImage captchaImage = internetIdentityService.getCaptchaImage(challenge);\n\nChallengeResult challengeResult = new ChallengeResult();\n\nchallengeResult.challengeKey = challenge.challengeKey;\n// set captcha characters from the png image\nchallengeResult.chars = \"a\";\n\nDeviceData device = new DeviceData();\ndevice.alias = \"Device 1\";\ndevice.pubkey = sessionKey;\n\nPurpose purpose = Purpose.authentication;\ndevice.purpose = purpose;\n\nKeyType keyType = KeyType.platform;\ndevice.keyType = keyType;\n\nCompletableFuture\u003cRegisterResponse\u003e registerResponse = internetIdentityService.register(device,\n\t\t\t\t\tchallengeResult);\n\nRegisterResponse register = registerResponse.get();\n\n\nLong userNumber = register.registeredValue.userNumber;\n\nString frontendHostname = \"http://0.0.0.0:8000/?canisterId=rdmx6-jaaaa-aaaaa-aaadq-cai\u0026id=renrk-eyaaa-aaaaa-aaada-cai\";\n\nCompletableFuture\u003cPrepareDelegationResponse\u003e response = internetIdentityService\n\t\t\t\t\t.prepareDelegation(userNumber, frontendHostname, sessionKey, Optional.empty());\n\nPrepareDelegationResponse prepareDelegationResponse = response.get();\nGetDelegationResponse getDelegationResponse = internetIdentityService.getDelegation(userNumber,\n\t\t\t\t\tfrontendHostname, sessionKey, prepareDelegationResponse.timestamp);\n\n\nPrincipal principal = internetIdentityService.getPrincipal(userNumber, frontendHostname);\n\n// generate a new device key pair\nKeyPair keyPair = InternetIdentityService.generateSessionKey();\n\ndevice.alias = \"Device 2\";\ndevice.pubkey = keyPair.getPublic().getEncoded();\n\nLong enterDeviceRegistrationModeResponse = internetIdentityService.enterDeviceRegistrationMode(userNumber)\n\t\t\t\t\t.get();\n\nAddTentativeDeviceResponse addTentativeDeviceResponse = internetIdentityService\n\t\t\t\t\t.addTentativeDevice(userNumber, device).get();\n\n\nVerifyTentativeDeviceResponse verifyTentativeDeviceResponse = internetIdentityService\n\t\t\t\t\t.verifyTentativeDevice(userNumber, addTentativeDeviceResponse.addedTentatively.verificationCode)\n\t\t\t\t\t.get();\n\ninternetIdentityService.exitDeviceRegistrationMode(userNumber);\n\ninternetIdentityService.add(userNumber, device);\n\nDeviceData[] deviceData = internetIdentityService.lookup(userNumber);\n\nIdentityAnchorInfo identityAnchorInfoResponse = internetIdentityService.getAnchorInfo(userNumber).get();\n\ninternetIdentityService.remove(userNumber, device.pubkey);\n\nInternetIdentityStats stats = internetIdentityService.stats();\n```\n\n\n# Downloads / Accessing Binaries\n\nTo add Java IC4J Internet Identity Service library to your Java project use Maven or Gradle import from Maven Central.\n\n\u003ca href=\"https://search.maven.org/artifact/ic4j/ic4j-internetidentity/0.7.5/jar\"\u003e\nhttps://search.maven.org/artifact/ic4j/ic4j-internetidentity/0.7.5/jar\n\u003c/a\u003e\n\n```\n\u003cdependency\u003e\n  \u003cgroupId\u003eorg.ic4j\u003c/groupId\u003e\n  \u003cartifactId\u003eic4j-internetidentity\u003c/artifactId\u003e\n  \u003cversion\u003e0.7.5\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n```\nimplementation 'org.ic4j:ic4j-internetidentity:0.7.5'\n```\n\n\n# Build\n\nYou need JDK 8+ to build IC4J Internet Identity Service.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fic4j%2Fic4j-internetidentity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fic4j%2Fic4j-internetidentity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fic4j%2Fic4j-internetidentity/lists"}