旅游网站建设属于什么以及学科商城网站开发解决方案
旅游网站建设属于什么以及学科,商城网站开发解决方案,万网怎么建立网站,app开发公司成都总览 最新版本的WSO2 Identity Server#xff08;版本5.0.0#xff09;配备了“应用程序身份验证框架”#xff0c;该框架提供了很大的灵活性#xff0c;可以对来自使用异构协议的各种服务提供商的用户进行身份验证。 它具有多个扩展点#xff0c;可用于满足企业系统中常见… 总览 最新版本的WSO2 Identity Server版本5.0.0配备了“应用程序身份验证框架”该框架提供了很大的灵活性可以对来自使用异构协议的各种服务提供商的用户进行身份验证。 它具有多个扩展点可用于满足企业系统中常见的几个自定义要求。 在这篇文章中我将分享使用这样一个扩展点的细节。 功能扩展 在企业系统中使用SAML单一登录时依赖方通过SAML响应来了解用户是否已通过身份验证。 在这一点上依赖方尚不知道其为业务和授权目的可能需要的已认证用户的其他属性。 为了向依赖方提供这些属性详细信息SAML规范允许在SAML响应中也发送属性。 WSO2 Identity Server通过为管理员提供的GUI开箱即用地支持此功能。 有关此功能和配置的详细信息请参阅[1]。 当我们需要向SAML响应中添加除下划线用户存储中可用的属性之外的其他属性时此特定扩展提供的灵活性会派上用场。 为了提供依赖方请求的所有属性可能需要寻找外部数据源。 在这里我要描述的样本中我们将研究一个场景该系统需要提供一些存储在用户存储中的用户本地属性以及一些我希望从外部数据源中检索到的其他属性。 遵循SAML响应是我们需要从WSO2 IS发送给依赖方的内容。 saml2p:Response Destinationhttps://localhost:9444/acs IDfaibaccbcepemkackalbbjkihlegenhhigcdjbjkInResponseTokbedjkocfjdaaadgmjeipbegnclbelfffbpbophe IssueInstant2014-07-17T13:15:05.032ZVersion2.0 xmlns:saml2purn:oasis:names:tc:SAML:2.0:protocolxmlns:xshttp://www.w3.org/2001/XMLSchemasaml2:Issuer Formaturn:oasis:names:tc:SAML:2.0:nameid-format:entityxmlns:saml2urn:oasis:names:tc:SAML:2.0:assertionlocalhost/saml2:Issuerds:Signature xmlns:dshttp://www.w3.org/2000/09/xmldsig#........../ds:Signaturesaml2p:Statussaml2p:StatusCode Valueurn:oasis:names:tc:SAML:2.0:status:Success//saml2p:Statussaml2:Assertion IDphmbbieedpcfdhcignelnepkemobepgaaipbjjdk IssueInstant2014-07-17T13:15:05.032Z Version2.0xmlns:saml2urn:oasis:names:tc:SAML:2.0:assertion xmlns:xshttp://www.w3.org/2001/XMLSchemasaml2:Issuer Formaturn:oasis:names:tc:SAML:2.0:nameid-format:entitylocalhost/saml2:Issuerds:Signature xmlns:dshttp://www.w3.org/2000/09/xmldsig#........./ds:Signaturesaml2:Subjectsaml2:NameID Formaturn:oasis:names:tc:SAML:1.1:nameid-format:emailAddressAdministrator/saml2:NameIDsaml2:SubjectConfirmation Methodurn:oasis:names:tc:SAML:2.0:cm:bearersaml2:SubjectConfirmationData InResponseTokbedjkocfjdaaadgmjeipbegnclbelfffbpbopheNotOnOrAfter2014-07-17T13:20:05.032ZRecipienthttps://localhost:9444/acs//saml2:SubjectConfirmation/saml2:Subjectsaml2:Conditions NotBefore2014-07-17T13:15:05.032Z NotOnOrAfter2014-07-17T13:20:05.032Zsaml2:AudienceRestrictionsaml2:AudiencecarbonServer2/saml2:Audience/saml2:AudienceRestriction/saml2:Conditionssaml2:AuthnStatement AuthnInstant2014-07-17T13:15:05.033Zsaml2:AuthnContextsaml2:AuthnContextClassRefurn:oasis:names:tc:SAML:2.0:ac:classes:Password/saml2:AuthnContextClassRef/saml2:AuthnContext/saml2:AuthnStatementsaml2:AttributeStatementsaml2:Attribute Namehttp://wso2.org/claims/roleNameFormaturn:oasis:names:tc:SAML:2.0:attrname-format:basicsaml2:AttributeValue xmlns:xsihttp://www.w3.org/2001/XMLSchema-instance xsi:typexs:stringInternal/carbonServer2,Internal/everyone/saml2:AttributeValue/saml2:Attributesaml2:AttributeStatementsaml2:Attribute Namehttp://pushpalanka.org/claims/keplerNumberNameFormaturn:oasis:names:tc:SAML:2.0:attrname-format:basicsaml2:AttributeValue xmlns:xsihttp://www.w3.org/2001/XMLSchema-instance xsi:typexs:stringE90836W19881010/saml2:AttributeValue/saml2:Attributesaml2:Attribute Namehttp://pushpalanka.org/claims/statusNameFormaturn:oasis:names:tc:SAML:2.0:attrname-format:basicsaml2:AttributeValue xmlns:xsihttp://www.w3.org/2001/XMLSchema-instance xsi:typexs:stringactive/saml2:AttributeValue/saml2:Attribute/saml2:AttributeStatement/saml2:AttributeStatement/saml2:Assertion
/saml2p:Response 在此响应中我们具有一个本地属性即角色和另外两个属性http://pushpalanka.org/claims/keplerNumber和http://pushpalanka.org/claims/status这些属性已从其他方法中检索出在我们的扩展名中定义。 怎么样 实施定制逻辑以获取外部声明。 我们仅需注意两个事实。 定制实现应实现接口“ org.wso2.carbon.identity.application.authentication.framework.handler.claims.ClaimHandler”或扩展接口“ org.wso2.carbon.identity.application.authentication”的默认实现。 framework.handler.claims.impl.DefaultClaimHandler”。 在方法“ public Map StringString handleClaimMappings”处返回的映射应包含我们要添加到SAML响应中的所有属性。 以下是我按照上面编写的示例代码。 外部声明可能已从数据库中查询从文件中读取或根据需要使用任何其他机制。 public class CustomClaimHandler implements ClaimHandler {private static Log log LogFactory.getLog(CustomClaimHandler.class);private static volatile CustomClaimHandler instance;private String connectionURL null;private String userName null;private String password null;private String jdbcDriver null;private String sql null;public static CustomClaimHandler getInstance() {if (instance null) {synchronized (CustomClaimHandler.class) {if (instance null) {instance new CustomClaimHandler();}}}return instance;}public MapString, String handleClaimMappings(StepConfig stepConfig,AuthenticationContext context, MapString, String remoteAttributes,boolean isFederatedClaims) throws FrameworkException {String authenticatedUser null;if (stepConfig ! null) {//calling from StepBasedSequenceHandlerauthenticatedUser stepConfig.getAuthenticatedUser();} else {//calling from RequestPathBasedSequenceHandlerauthenticatedUser context.getSequenceConfig().getAuthenticatedUser();}MapString, String claims handleLocalClaims(authenticatedUser, context);claims.putAll(handleExternalClaims(authenticatedUser));return claims;}/*** param context* return* throws FrameworkException*/protected MapString, String handleLocalClaims(String authenticatedUser,AuthenticationContext context) throws FrameworkException {....}private MapString, String getFilteredAttributes(MapString, String allAttributes,MapString, String requestedClaimMappings, boolean isStandardDialect) {....}protected String getDialectUri(String clientType, boolean claimMappingDefined) {....}/*** Added method to retrieve claims from external sources. This results will be merged to the local claims when* returning final claim list, to be added to the SAML response, that is sent back to the SP.** param authenticatedUser : The user for whom we require claim values* return*/private MapString, String handleExternalClaims(String authenticatedUser) throws FrameworkException {MapString, String externalClaims new HashMapString, String();externalClaims.put(http://pushpalanka.org/claims/keplerNumber,E90836W19881010);externalClaims.put(http://pushpalanka.org/claims/status,active);return externalClaims;}
} 将已编译的OSGI软件包放在IS_HOME / repository / components / dropins中。 我们将其开发为OSGI捆绑软件因为我们还需要使用RealmService获得本地声明。 您可以在此处找到完整的捆绑软件和源代码 使WSO2 Identity Server使用我们拥有的新的自定义实现。 在IS_HOME / repository / conf / security / applicationauthentication.xml中配置新的处理程序名称。 在“ ApplicationAuthentication.Extensions.ClaimHandler”元素中。 ClaimHandlercom.wso2.sample.claim.handler.CustomClaimHandler/ClaimHandler 现在如果查看生成的SAML响应我们将看到添加的外部属性。 干杯! [1] – https://docs.wso2.com/display/IS500/AddingaServiceProvider 翻译自: https://www.javacodegeeks.com/2014/08/adding-custom-claims-to-the-saml-response-how-to-write-a-custom-claim-handler-for-wso2-identity-server.html
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/pingmian/86995.shtml
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!