Adding attributes to a credential
This scenario illustrates how to add custom attributes to a credential during authentication.
Script
-- IBM Confidential
-- PID 5725-V89 5725-V90 5737-F02
--
-- Copyright IBM Corp. 2023
-- This script is used to add a single attribute to a user
-- credential during authentication.
Session.setCredentialAttribute("my-credential-attribute", "attr-value")
Note: A rule that adds attributes to a credential must be
triggered during the postauthn stage. The following entry illustrates
how to configure a rule to be invoked during the postauthn
stage:
[https-transformations:my-resource]
request-match = postauthn:password