Support for adding custom claims in the OIDC access token
Context
There is a need to have custom claims in the access token generated by the OIDC plugin. For this new UI fields were added in the OIDC applications in order to allow users to choose what custom attributes to add.
Configuration in Veridium server
From the OIDC application page (either edit or create new), go to the Advance tab.

With this selection, we can specify what kind of attribute to be present in access token as a claim directly.
Having this set, we can start an OIDC authorization flow code and verify if the access token will have the requested attribute:
With a client of OIDC, for example OIDC debugger, we can start a OIDC flow like authorization flow:

Sending this request and successfully authenticate it will redirect to OIDC debugger page where we can see the access token, in the decode JWT from access token we can spot the requested custom claim from admin side:

This is for SSO part, however the client wants this custom claim to be present in the next token:
Copying the authorization code from OIDC debugger response and make a postman call with it for exchanging the tokens, then we will see the custom claim in the OAuth.Token step.
https://cbodnar.veridium-dev.com:11443/idp/profile/oidc/token?grant_type=authorization_code&client_id=veridium_client&client_secret=secret&redirect_uri=https://oidcdebugger.com/debug&code=AAdzZWNyZXQxVpVYHy9sgtGRkfDT-HaxWQNfQXV9AVcAfiCP_amUyMMA0xHlqeArDd9dYD7Obyry5ywnSCDiMRYgtcf0fUei1h2FfHQR0WIK-9MzBcpvU4HtJXpg55A1PHHwIslDfAl75TvDSXTxWvyi67Eu0E_qz7LId162c07Q2YePy9_IQPU7Apz6iSxyK6fDlckHZZN5qPxZFE466rNHMbVjQnb5X9iNZwIElglKK6PGPvWpBd5YI1pJKDbhNHONXIxGllzgVMPaPLdu-CqofBm-P8NuoTAyVr6D7yCl2lLFAa1rxXQ5f5UmcQQpuW_a6lBxrce4AkItC5j2cq1kD49KihHrDPLQ1lgZK6IJ9M3WONW-zq7Rtlg_5A1ymAM7RfQAnBu-YveWbg93-hgf3ExfM-73Bc-19rd6QHVQeax00NrCoCOGGCH-67iIQOX7aPGYhp8s_2sc_buveagEAVfa2qzS_qkQR8JXXJGB4kiHeEQI_xkv0U069etZg5xJ6Caw7ZPON_51GJB_kMzsNzD2BmoSf6BgvDIHKu4YLJvA2LNRty9n52IF1ELyQq0TSbBrA5YPn6Ph_r87NCLrqQrNA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