HTTP Claims in FIDO2 Mediator JavaScript Mapping Rules
HTTP Request claims can be accessed by a FIDO Mediator mapping rule from the context.requestData variable that is defined by default in FIDO mapping rules.
If sps.httpRequestClaims.enabled (see SPS HTTP Request Claims) is true, then header, cookie and parameter values are added to the requestData field of the context parameter. The following example is an example for retrieving and logging HTTP headers from the request claims:
var headers = context.requestData.headers for (var name in headers) { var value = context.requestData.headers[name]; IDMappingExtUtils.traceString("Header with name [" + name + "] and value [" + value + "]"); }
A similar code can be used to access cookies and query string parameters, providing values match the regex filter defined in the sps.httpRequestClaims.filterSpec (see SPS HTTP Request Claims)) advanced configuration parameter.
Parent topic: HTTP Claims