digitalcredentials / learner-credential-wallet

Learner Credential Wallet is a cross-platform iOS and Android mobile application for storing and sharing digital learner credentials.
https://lcw.app
MIT License
54 stars 28 forks source link

Adding the open badges identity object.name #539

Closed kayaelle closed 2 months ago

kayaelle commented 8 months ago

Open Badges 3.0 added "name" for a person's full name to the identity object: https://www.imsglobal.org/spec/ob/v3p0#org.1edtech.ob.v3p0.identifiertypeenum.class

We have been putting name in the credentialSubject but this wasn't articulated in any specs. Open Badges <=2.0 typically used email address as an identity object but in 3.0 email is needed less (if at all). Degrees often have the legal name of the person who earned the degree so we recommended to 1EdTech that name be added to the identity object.

The identity object has some required fields that we should discuss: https://www.imsglobal.org/spec/ob/v3p0#identityobject especially including "hashed" which I think is unnecessary so we could set this to false.

When we implement, we'll want to test against the OBv3 schema to double-check that it's been included properly in there and that they aren't requiring hashed to be true or anything like that. It's also possible that "salt" may be required even if hashed is false (even though it shouldn't be) so we should test for that too.

This affects LCW, Verifier Plus, (anywhere else?) and we should make new examples that include this new property. We should keep examples and code where credentialSubject.name is used for backwards compatibility.

This issue is intended to be the set up for those issues. Tagging @stuartf, @kimdhamilton, @dmitrizagidulin as a heads up for modeling.

dmitrizagidulin commented 7 months ago

@kayaelle

We have been putting name in the credentialSubject but this wasn't articulated in any specs.

Fwiw - the credentialSubject.name field is in the VC Data Model 2.0 context, so it's basically in the main spec.

kayaelle commented 7 months ago

@dmitrizagidulin - a few thoughts:

DCC did use it as credentialSubject.name but we needed it to be specified in the OB spec because they have an identity object that others are using so it makes sense to have it there for OB & CLR consistency. Since name is in there, we need to support it and we may as well use it. We can continue to support both.

It looks to me like credentialSubject.name in VC 1.1 isn't in the @context and in v2 it references: https://schema.org/name which isn't specified as a person's name but in the OB spec it is.

dmitrizagidulin commented 7 months ago

@kayaelle

It looks to me like credentialSubject.name in VC 1.1 isn't in the @context and in v2 it references: https://schema.org/name which isn't specified as a person's name but in the OB spec it is.

Yeah, I specifically meant it's in the v2 context (which, I know, hasn't reached OBv3 yet). And https://schema.org/name ALSO applies to persons, it's a general/universal property. Specifically, name belongs to type Thing, and Person inherits from Thing.

image

kayaelle commented 7 months ago

This is an example credential that contains the identityObject with the name: https://github.com/digitalcredentials/docs/blob/main/example-credentials/ob3-indentifier-object-name.json

Deeplink that can be used for testing: https://lcw.app/request.html?issuer=issuer.example.com&auth_type=bearer&challenge=10cc9b69-318a-4099-95a0-7ea0d8c07d27&vc_request_url=https://issuer.dcconsortium.org/exchange/4d15aa7b-db5c-4e94-94fb-d35e446b376a/10cc9b69-318a-4099-95a0-7ea0d8c07d27

alexfigtree commented 5 months ago

@dmitrizagidulin Confirms that this work affects LCW and Verifier Plus only.

alexfigtree commented 4 months ago

Reference:

"identifier": [
      {
        "type": "IdentityObject",
        "identityHash": "student@1edtech.edu",
        "identityType": "emailAddress",
        "hashed": false,
        "salt": "not-used"
      },
      {
        "type": "IdentityObject",
        "identityHash": "Jane Smith",
        "identityType": "name",
        "hashed": false,
        "salt": "not-used"
      }
    ],

https://www.imsglobal.org/spec/ob/v3p0#org.1edtech.ob.v3p0.identifiertypeenum.class

alexfigtree commented 4 months ago

Digitally signed for testing:

{"@context":["https://www.w3.org/2018/credentials/v1","https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.2.json","https://w3id.org/security/suites/ed25519-2020/v1"],"id":"urn:uuid:d5d2fbd1-c1c7-466e-bb83-12b84e07d20b","type":["VerifiableCredential","OpenBadgeCredential"],"name":"DCC Test Credential","issuer":{"type":["Profile"],"id":"did:key:z6MkgPBJwKZD8FeFYpps9opan1VdVAeo8EvzJc15BofGujkV","name":"Digital Credentials Consortium Test Issuer","url":"https://www.dcconsortium.org/","image":"https://user-images.githubusercontent.com/947005/133544904-29d6139d-2e7b-4fe2-b6e9-7d1022bb6a45.png"},"issuanceDate":"2024-04-24T15:40:20.623Z","credentialSubject":{"type":["AchievementSubject"],"identifier":[{"type":"IdentityObject","hashed":false,"identityHash":"Sam Smith","identityType":"name"}],"achievement":{"id":"urn:uuid:bd6d9316-f7ae-4073-a1e5-2f7f5bd22922","type":["Achievement"],"achievementType":"Badge","name":"Badge","description":"This is a sample credential issued by the Digital Credentials Consortium to demonstrate the functionality of Verifiable Credentials for wallets and verifiers.","criteria":{"type":"Criteria","narrative":"This credential has the following criteria - achievementType Badge, subjectName, exists in issuer registry, not revoked, not expired, linked issuer image."},"image":{"id":"https://user-images.githubusercontent.com/752326/214947713-15826a3a-b5ac-4fba-8d4a-884b60cb7157.png","type":"Image"}},"name":"Ian Malcom"},"expirationDate":"2025-12-20T22:42:27.438Z","proof":{"type":"Ed25519Signature2020","created":"2024-04-24T15:40:20Z","verificationMethod":"did:key:z6MkgPBJwKZD8FeFYpps9opan1VdVAeo8EvzJc15BofGujkV#z6MkgPBJwKZD8FeFYpps9opan1VdVAeo8EvzJc15BofGujkV","proofPurpose":"assertionMethod","proofValue":"z2kt46rcSJbNBMQsK8utUXYGe1ztpJ5pcS7x29uaQdAAmGUeKwNHwy6mCR12dJrM5TMWUQzXvnc4GXPQVSaL7Vkxd"}}
alexfigtree commented 3 months ago

Reopening this until deployment

alexfigtree commented 2 months ago

Deployed to both Google Play and App Store (release 2.1.0-build80), closing ticket.