繁体   English   中英

WSO2 IS 联合身份验证器声明

[英]WSO2 IS Federated Authenticator claim

如何将联合身份验证器作为声明发送给我的服务提供商?

SP 想知道哪个已用于验证主题。 是否有本地 IS 要求将其发送回 SP?

我已经知道始终发回经过身份验证的身份提供者列表,但我需要发送声明。

提前致谢。

您可以编写一个自定义声明处理程序来处理声明映射并将其部署到 IS 服务器中。 您可以按照此文档创建自定义索赔处理程序https://docs.wso2.com/display/IS580/Writing+a+Custom+Claim+Handler 您可以从 AuthneticatedUser object [1] 获取 federatedIdpName。

下面给出了一个示例代码。

public Map<String, String> handleClaimMappings(StepConfig stepConfig,
                                               AuthenticationContext context, Map<String, String> remoteAttributes,
                                               boolean isFederatedClaims) throws FrameworkException {

    String authenticatedUser = null;

    if (stepConfig != null) {
        //calling from StepBasedSequenceHandler
        authenticatedUser = stepConfig.getAuthenticatedUser();
    } else {
        //calling from RequestPathBasedSequenceHandler
        authenticatedUser = context.getSequenceConfig().getAuthenticatedUser();
    }

    Map<String, String> claims = handleExternalClaims(authenticatedUser);
    return claims;
}

private Map<String, String> handleExternalClaims(AuthenticatedUser authenticatedUser) throws FrameworkException {

    Map<String, String> externalClaims = new HashMap<String, String>();
    externalClaims.put("http://test.org/claims/idpName", authenticatedUser.getFederatedIdPName());
    return externalClaims;
}

[1] https://github.com/wso2/carbon-identity-framework/blob/master/components/authentication-framework/org.wso2.carbon.identity.application.authentication.framework/src/main/java/org /wso2/carbon/identity/application/authentication/framework/model/AuthenticatedUser.java#L49

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM