Different tokens might have different names under which the information of interest
resides. Map the different attributes into a common name to enable application of any business
logic.
Procedure
-
When you working with different kind of token, the information may exist under many different
names. A pre-defined json which contain token type and original name and universal name mapping can
be provided:
var universalNameMapJson = {
"urn:ietf:params:oauth:token-type:jwt": {
"sub": "uni_sub",
"aud": "uni_aud",
"exp": "uni_exp",
"iss": "uni_iss",
"scope": "uni_scope",
"act": "uni_act"
},
"urn:ietf:params:oauth:token-type:saml2": {
"subject": "uni_sub",
"audience": "uni_aud",
"expire": "uni_exp",
"issuer": "uni_iss"
}
};
- Put all the information with
common name into a JSON. For example:
var actClaimsJson = JSON.parse(
OAuthMappingExtUtils.parseSTSUUToJson(act_stsuu, actor_token_type, JSON.stringify(universalNameMapJson))
);