Thursday, July 01, 2010

Information Cards in JSON

I added some code to xmldap to serialize Information Cards to JSON.
The rationale is that XML and especially XML Signature are a mess on mobile devices. J2ME is java1.3 and thus from the stoneage. But Android (java 6) is not better because javax.xml.transform is missing. Arghh!

- I am throwing away namespaces
- No deaply nested XML structures.
- No signature (yet?)!

I would like to standardize this or something similar.

This is a Britisch Columbia Card from the RSA interop in JSON:


{
"CardId": "urn:GUID:6d6693c1-6b1a-df11-b009-00143851d232",
"IssuerName": "stsip.systestv2.bceid.ca",
"MimeType": "image/jpeg",
"lang": "en-us",
"TokenServiceList": [
{
"UserCredential": {
"Type": "UserNamePasswordAuthenticate",
"Username": "SBCEID\\pwiebe10i"
},
"Address": "https://stsip.systestv2.bceid.ca/adfs/services/trust/mex"
},
{
"UserCredential": {
"Type": "UserNamePasswordAuthenticate",
"Username": "SBCEID\\pwiebe10i"
},
"Address": "https://stsip.systestv2.bceid.ca/adfs/services/trust/mex"
}
],
"SupportedTokenTypeList": ["http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0"],
"Issuer": "http://stsip.systestv2.bceid.ca/adfs/services/trust",
"CardVersion": 4,
"SupportedClaimTypeList": [
{
"Description": "Level of Assurance achieved according to the rules of the ICAM IMI 1.0 profile located at http://www.idmanagement.gov/",
"Uri": "http://idmanagement.gov/icam/2009/09/imi_1.0_profile#assurancelevel1",
"DisplayTag": "ICAM Assurance Level 1"
},
{
"Uri": "http://www.cio.gov.bc.ca/standards/claims/2009/11/useridentifier",
"DisplayTag": "User Identifier"
},
{
"Uri": "http://www.ocio.gov.bc.ca/standards/claims/2009/06/userdisplayname",
"DisplayTag": "User Display Name"
},
{
"Uri": "http://www.ocio.gov.bc.ca/standards/claims/2009/09/identityassurancelevel",
"DisplayTag": "Identity Assurance Level"
},
{
"Uri": "http://www.ocio.gov.bc.ca/standards/claims/2009/09/authoritativepartyidentifier",
"DisplayTag": "AP Identifier"
},
{
"Uri": "http://www.ocio.gov.bc.ca/standards/claims/2009/09/authoritativepartyname",
"DisplayTag": "AP Name"
},
{
"Uri": "http://www.cio.gov.bc.ca/standards/claims/2009/09/identityassurancelevel1",
"DisplayTag": "Identity Assurance Level 1"
},
{
"Description": "The e-mail address of the user",
"Uri": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress",
"DisplayTag": "E-Mail Address"
},
{
"Description": "The given name of the user",
"Uri": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname",
"DisplayTag": "Given Name"
},
{
"Description": "The unique name of the user",
"Uri": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name",
"DisplayTag": "Name"
},
{
"Description": "The user principal name (UPN) of the user",
"Uri": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn",
"DisplayTag": "UPN"
},
{
"Description": "The surname of the user",
"Uri": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname",
"DisplayTag": "Surname"
},
{
"Description": "The private identifier of the user",
"Uri": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/privatepersonalidentifier",
"DisplayTag": "PPID"
},
{
"Description": "The SAML name identifier of the user",
"Uri": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier",
"DisplayTag": "Name ID"
},
{
"Description": "Used to display the time and date that the user was authenticated",
"Uri": "http://schemas.microsoft.com/ws/2008/06/identity/claims/authenticationinstant",
"DisplayTag": "Authentication time stamp"
},
{
"Description": "The method used to authenticate the user",
"Uri": "http://schemas.microsoft.com/ws/2008/06/identity/claims/authenticationmethod",
"DisplayTag": "Authentication method"
}
],
"CardName": "BCeID Information Card",
"TimeIssued": "2010-04-15T17:52:07.341Z",
"RequireAppliesTo": false,
"CardType": "urn:GUID:6d6693c1-6b1a-df11-b009-00143851d232",
"CardImage": "/9j/4AAQSkZJRgABAQEAeAB4AAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBD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5mIGcAnAA707TtM1XTlkt4prfyWbIdgSw/CvMxcJOcFq49bdzqoySjJ9S/aaUIrs3lxKZ7kjAYjAUegFct4B/5GHxh/2Ej/AFrshHNBZlIWE0wBKmZiAze5AOB9BXMeFvD2taJrGq3V3JYSw6lcGdxE7hozzwMrz1HpXZQhGFNpaXMZtykmVLT/AJLVf/8AYJX/ANDWu5JAUk8Ada4dvDviaPxvJ4kgfS/ngFu1s0kmCnB+9t65HpWvf2Gv6zbNZz3Fpp1tKNsrWrNLKynqAzBQufXBraVnbUhXVznPhKh+x67PGCLSXUHMPoQPT9K9FqnpemWmjabDYWMQit4Vwqj+Z9SauVE5c0myoqysFFFFSMKKKKACiiigAooooAKKKKACiiigAooooAKKKKACiiigD//Z"
}


Minor nit: lang="en-us". Might be better to use "en-ca"?

1 comment:

Anonymous said...
This comment has been removed by a blog administrator.