我正在使用AD B2C service
进行身份验证。
AD B2C 正在生成已签名的 JWT 令牌,但 JWT 令牌中的声明信息向公众公开。如果有人获得令牌,他们就可以看到索赔信息。
就我而言,我需要在 JWT 令牌中存储一些敏感信息。那么有没有什么办法可以在AD B2C中生成JWE token(加密token),这样只有预期的接收者才能读取。
是否有任何可能的解决方案来修改JwtIssuer ClaimsProvider
自定义策略以实现 JWE。请建议
<ClaimsProvider>
<DisplayName>Token Issuer</DisplayName>
<TechnicalProfiles>
<TechnicalProfile Id="JwtIssuer">
<DisplayName>JWT Issuer</DisplayName>
<Protocol Name="None" />
<OutputTokenFormat>JWT</OutputTokenFormat>
<Metadata>
<Item Key="client_id">{service:te}</Item>
<Item Key="issuer_refresh_token_user_identity_claim_type">objectId</Item>
<Item Key="SendTokenResponseBodyWithJsonNumbers">true</Item>
</Metadata>
<CryptographicKeys>
<Key Id="issuer_secret" StorageReferenceId="B2C_1A_TokenSigningKeyContainer" />
<Key Id="issuer_refresh_token_key" StorageReferenceId="B2C_1A_TokenEncryptionKeyContainer" />
</CryptographicKeys>
<InputClaims />
<OutputClaims />
</TechnicalProfile>
</TechnicalProfiles>
</ClaimsProvider>