exports.onExecutePostLogin = async (event, api) => {
// WS-Fedアプリケーションにのみ変更を適用する
if (event.client.name !== 'Your ws-fed application name') {
return;
}
// upnクレームの作成を除外する(デフォルトはtrue)
api.samlResponse.setCreateUpnClaim(false);
// アイデンティティ配列を除外する(デフォルトはtrue)
api.samlResponse.setMapIdentities(false);
// 明示的にマッピングされていないクレームを除外する(デフォルトはtrue)
api.samlResponse.setPassthroughClaimsWithNoMapping(false);
// これはデフォルトのマッピングです。必要に応じて削除または変更してください。
api.samlResponse.setAttribute('http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier', event.user.user_id);
api.samlResponse.setAttribute('http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress', event.user.email || null);
api.samlResponse.setAttribute('http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name', event.user.name || null);
api.samlResponse.setAttribute('http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname', event.user.given_name || null);
api.samlResponse.setAttribute('http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname', event.user.family_name || null);
};