当前位置: 首页>>代码示例>>Java>>正文


Java IdentityConstants类代码示例

本文整理汇总了Java中org.wso2.carbon.identity.base.IdentityConstants的典型用法代码示例。如果您正苦于以下问题:Java IdentityConstants类的具体用法?Java IdentityConstants怎么用?Java IdentityConstants使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IdentityConstants类属于org.wso2.carbon.identity.base包,在下文中一共展示了IdentityConstants类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: evaluate

import org.wso2.carbon.identity.base.IdentityConstants; //导入依赖的package包/类
/**
 * Evaluates the given XACML request and returns the Response
 *
 * @param requestCtx Balana Object model for request
 * @param xacmlRequest Balana Object model for request
 * @return ResponseCtx  Balana Object model for response
 */
public ResponseCtx evaluate(AbstractRequestCtx requestCtx, String xacmlRequest) {

    if (log.isDebugEnabled() && IdentityUtil.isTokenLoggable(IdentityConstants.IdentityTokens.XACML_REQUEST)) {
        log.debug("XACML Request : " + xacmlRequest);
    }

    ResponseCtx xacmlResponse;

    if ((xacmlResponse = (ResponseCtx) getFromCache(xacmlRequest, false)) != null) {
        if (log.isDebugEnabled() && IdentityUtil.isTokenLoggable(IdentityConstants.IdentityTokens.XACML_RESPONSE)) {
            log.debug("XACML Response : " + xacmlResponse);
        }
        return xacmlResponse;
    }

    xacmlResponse = pdp.evaluate(requestCtx);

    addToCache(xacmlRequest, xacmlResponse, false);

    if (log.isDebugEnabled() && IdentityUtil.isTokenLoggable(IdentityConstants.IdentityTokens.XACML_RESPONSE)) {
        log.debug("XACML Response : " + xacmlResponse);
    }
    return xacmlResponse;
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:32,代码来源:EntitlementEngine.java

示例2: getAllSupportedClaims

import org.wso2.carbon.identity.base.IdentityConstants; //导入依赖的package包/类
/**
 * @return
 * @throws UserStoreException
 */
private Claim[] getAllSupportedClaims(UserRealm realm, String dialectUri)
        throws org.wso2.carbon.user.api.UserStoreException {
    ClaimMapping[] claims = null;
    List<Claim> reqClaims = null;

    claims = realm.getClaimManager().getAllSupportClaimMappingsByDefault();
    reqClaims = new ArrayList<Claim>();
    for (int i = 0; i < claims.length; i++) {
        if (dialectUri.equals(claims[i].getClaim().getDialectURI()) && (claims[i] != null && claims[i].getClaim().getDisplayTag() != null
                && !claims[i].getClaim().getClaimUri().equals(IdentityConstants.CLAIM_PPID))) {

            reqClaims.add((Claim) claims[i].getClaim());
        }
    }

    return reqClaims.toArray(new Claim[reqClaims.size()]);
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:22,代码来源:UserProfileAdmin.java

示例3: overrideResidentIdpEPUrls

import org.wso2.carbon.identity.base.IdentityConstants; //导入依赖的package包/类
/**
 * Overrides the persisted endpoint URLs (e.g. SAML endpoint) if the hostname/port has been changed.
 * @param residentIDP
 * @throws IdentityProviderManagementException
 */
private void overrideResidentIdpEPUrls(IdentityProvider residentIDP)
        throws IdentityProviderManagementException {

    // Not all endpoints are persisted. So we need to update only a few properties.

    String samlSSOUrl = IdentityUtil.getServerURL(IdentityConstants.ServerConfig.SAMLSSO, true, true);
    updateFederationAuthenticationConfigProperty(residentIDP,
            IdentityApplicationConstants.Authenticator
                    .SAML2SSO.NAME, IdentityApplicationConstants.Authenticator.SAML2SSO.SSO_URL, samlSSOUrl);

    String samlLogoutUrl = IdentityUtil.getServerURL(IdentityConstants.ServerConfig.SAMLSSO, true, true);;
    updateFederationAuthenticationConfigProperty(residentIDP,
            IdentityApplicationConstants.Authenticator
                    .SAML2SSO.NAME, IdentityApplicationConstants.Authenticator.SAML2SSO.LOGOUT_REQ_URL, samlLogoutUrl);

    String passiveStsUrl = IdentityUtil.getServerURL(IdentityConstants.STS.PASSIVE_STS, true, true);
    updateFederationAuthenticationConfigProperty(residentIDP,
            IdentityApplicationConstants.Authenticator.PassiveSTS.NAME, IdentityApplicationConstants
                    .Authenticator.PassiveSTS.IDENTITY_PROVIDER_URL, passiveStsUrl);
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:26,代码来源:IdentityProviderManager.java

示例4: OpenIDProvider

import org.wso2.carbon.identity.base.IdentityConstants; //导入依赖的package包/类
/**
 * Configure the OpenID Provider's end-point URL
 */
private OpenIDProvider() {
    // This is the OpenID provider server URL
    opAddress = OpenIDUtil.getOpenIDServerURL();
    // The URL which accepts OpenID Authentication requests, obtained by
    // performing discovery on the the User-Supplied Identifier. This value
    // must be an absolute URL
    manager.setOPEndpointUrl(opAddress);

    // default association expiry time is set to 15 minutes
    int assocExpiryTime = 15;
    String expiryTime = IdentityUtil.getProperty(IdentityConstants.ServerConfig.OPENID_ASSOCIATION_EXPIRY_TIME);
    if (expiryTime != null && !expiryTime.trim().isEmpty()) {
        try {
            assocExpiryTime = Integer.parseInt(expiryTime);
        } catch (NumberFormatException e) {
            log.warn("Error while setting association expiry time as " + expiryTime
                    +  ". Setting association expiry time to default ("+assocExpiryTime+")", e);
        }
    }
    manager.setExpireIn(assocExpiryTime);
}
 
开发者ID:wso2-attic,项目名称:carbon-identity,代码行数:25,代码来源:OpenIDProvider.java

示例5: isExpired

import org.wso2.carbon.identity.base.IdentityConstants; //导入依赖的package包/类
/**
 * Checks if the rememberMe token is expired
 *
 * @param storedDo
 * @return
 */
private boolean isExpired(OpenIDRememberMeDO storedDo) {
    Timestamp timestamp = storedDo.getTimestamp();
    String expiry = IdentityUtil.getProperty(IdentityConstants.ServerConfig.OPENID_REMEMBER_ME_EXPIRY);
    if (timestamp != null && expiry != null) {
        long t0 = timestamp.getTime();
        long t1 = new Date().getTime();
        long delta = Long.parseLong(expiry) * 1000 * 60;

        if (t1 - t0 > delta) {
            log.debug("Remember Me token expired for user " + storedDo.getUserName());
            return true;
        }
    }
    return false;
}
 
开发者ID:wso2-attic,项目名称:carbon-identity,代码行数:22,代码来源:OpenIDRememberMeTokenManager.java

示例6: processInfoCardReference

import org.wso2.carbon.identity.base.IdentityConstants; //导入依赖的package包/类
/**
 * @param rst
 * @throws IdentityProviderException
 */
@Override
protected void processInfoCardReference(OMElement rst) throws IdentityProviderException {
    OMElement infoCardRef = null;
    OMElement omCardID = null;

    if (log.isDebugEnabled()) {
        log.debug("Processing information card reference");
    }

    infoCardRef = rst.getFirstChildWithName(new QName(IdentityConstants.NS,
                                                      IdentityConstants.LocalNames.INFO_CARD_REFERENCE));

    omCardID = infoCardRef.getFirstChildWithName(new QName(IdentityConstants.NS,
                                                           IdentityConstants.LocalNames.CARD_ID));

    this.cardID = omCardID.getText();
}
 
开发者ID:wso2-attic,项目名称:carbon-identity,代码行数:22,代码来源:IdentityProviderData.java

示例7: getTenantDomain

import org.wso2.carbon.identity.base.IdentityConstants; //导入依赖的package包/类
@Override
public String getTenantDomain() throws IdentityProviderException {
    if (this.authMechanism == IdentityConstants.AUTH_TYPE_SELF_ISSUED) { //only for tenant 0
        return null;
    }

    if (userIdentifier == null) {
        // auth type is not self issued and still the user identifier is null. 
        // this is a invalid case
        throw new IllegalStateException("User identifier must NOT be null");
    }

    String domain = null;
    domain = MultitenantUtils.getTenantDomain(userIdentifier);
    return domain;
}
 
开发者ID:wso2-attic,项目名称:carbon-identity,代码行数:17,代码来源:IdentityProviderData.java

示例8: getDisplayName

import org.wso2.carbon.identity.base.IdentityConstants; //导入依赖的package包/类
/**
 * @param uri
 * @return
 */
@Override
public String getDisplayName(String uri) {
    Claim claim = null;

    if (log.isDebugEnabled()) {
        log.debug("");
    }

    claim = supportedClaims.get(uri);
    if (claim != null) {
        if (IdentityConstants.CLAIM_PPID.equals(claim.getClaimUri())) {
            return IdentityConstants.PPID_DISPLAY_VALUE;
        }
        return claim.getDisplayTag();
    }
    return null;
}
 
开发者ID:wso2-attic,项目名称:carbon-identity,代码行数:22,代码来源:IdentityProviderData.java

示例9: createDisplayClaim

import org.wso2.carbon.identity.base.IdentityConstants; //导入依赖的package包/类
public static OMElement createDisplayClaim(OMElement parent, String displayTag,
                                           String displayValue, String uri) {
    OMElement claimElem = createOMElement(parent, IdentityConstants.NS,
                                          IdentityConstants.LocalNames.DISPLAY_CLAIM, IdentityConstants.PREFIX);

    claimElem.addAttribute("Uri", uri, null);

    OMElement tagElem = createOMElement(claimElem, IdentityConstants.NS,
                                        IdentityConstants.LocalNames.DISPLAY_TAG, IdentityConstants.PREFIX);
    tagElem.setText(displayTag);

    OMElement valElem = createOMElement(claimElem, IdentityConstants.NS,
                                        IdentityConstants.LocalNames.DISPLAY_VALUE, IdentityConstants.PREFIX);
    valElem.setText(displayValue);

    return claimElem;
}
 
开发者ID:wso2-attic,项目名称:carbon-identity,代码行数:18,代码来源:IdentityProviderUtil.java

示例10: SAMLSSOServiceProviderDO

import org.wso2.carbon.identity.base.IdentityConstants; //导入依赖的package包/类
public SAMLSSOServiceProviderDO() {
    if (StringUtils.isNotBlank(IdentityUtil.getProperty(IdentityConstants.ServerConfig
            .SSO_DEFAULT_SIGNING_ALGORITHM))) {
        signingAlgorithmUri = IdentityUtil.getProperty(IdentityConstants.ServerConfig
                .SSO_DEFAULT_SIGNING_ALGORITHM).trim();
    } else {
        signingAlgorithmUri = IdentityCoreConstants.XML_SIGNATURE_ALGORITHM_RSA_SHA1_URI;
    }
    if (StringUtils.isNotBlank(IdentityUtil.getProperty(IdentityConstants.ServerConfig
            .SSO_DEFAULT_DIGEST_ALGORITHM))) {
        digestAlgorithmUri = IdentityUtil.getProperty(IdentityConstants.ServerConfig
                .SSO_DEFAULT_DIGEST_ALGORITHM).trim();
    } else {
        digestAlgorithmUri = IdentityCoreConstants.XML_DIGEST_ALGORITHM_SHA1;
    }
}
 
开发者ID:wso2-attic,项目名称:carbon-identity,代码行数:17,代码来源:SAMLSSOServiceProviderDO.java

示例11: test

import org.wso2.carbon.identity.base.IdentityConstants; //导入依赖的package包/类
/**
 * Test request for PDP
 *
 * @param xacmlRequest XACML request as String
 * @return response as String
 */
public String test(String xacmlRequest) {

    if (log.isDebugEnabled() && IdentityUtil.isTokenLoggable(IdentityConstants.IdentityTokens.XACML_REQUEST)) {
        log.debug("XACML Request : " + xacmlRequest);
    }

    String xacmlResponse = pdpTest.evaluate(xacmlRequest);

    if (log.isDebugEnabled() && IdentityUtil.isTokenLoggable(IdentityConstants.IdentityTokens.XACML_RESPONSE)) {
        log.debug("XACML Response : " + xacmlResponse);
    }

    return xacmlResponse;
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:21,代码来源:EntitlementEngine.java

示例12: getSigningAlgoURIByConfig

import org.wso2.carbon.identity.base.IdentityConstants; //导入依赖的package包/类
/**
 * @return the Signing Algorithm URI defined in configuration
 */
public static String getSigningAlgoURIByConfig() {
    if (StringUtils.isNotBlank(IdentityUtil.getProperty(IdentityConstants.ServerConfig
            .SSO_DEFAULT_SIGNING_ALGORITHM))) {
        return IdentityUtil.getProperty(IdentityConstants.ServerConfig.SSO_DEFAULT_SIGNING_ALGORITHM).trim();
    } else {
        return IdentityApplicationConstants.XML.SignatureAlgorithmURI.RSA_SHA1;
    }
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:12,代码来源:IdentityApplicationManagementUtil.java

示例13: getDigestAlgoURIByConfig

import org.wso2.carbon.identity.base.IdentityConstants; //导入依赖的package包/类
/**
 * @return the Digest Algorithm URI defined in configuration
 */
public static String getDigestAlgoURIByConfig() {
    if (StringUtils.isNotBlank(IdentityUtil.getProperty(IdentityConstants.ServerConfig
            .SSO_DEFAULT_DIGEST_ALGORITHM))) {
        return IdentityUtil.getProperty(IdentityConstants.ServerConfig.SSO_DEFAULT_DIGEST_ALGORITHM).trim();
    } else {
        return IdentityApplicationConstants.XML.DigestAlgorithmURI.SHA1;
    }
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:12,代码来源:IdentityApplicationManagementUtil.java

示例14: getAssertionEncryptionAlgorithmURIByConfig

import org.wso2.carbon.identity.base.IdentityConstants; //导入依赖的package包/类
/**
 * @return the Assertion Encryption Algorithm URI defined in configuration
 */
public static String getAssertionEncryptionAlgorithmURIByConfig() {
    if (StringUtils.isNotBlank(IdentityUtil.getProperty(IdentityConstants.ServerConfig
            .SSO_DEFAULT_ASSERTION_ENCRYPTION_ALGORITHM))) {
        return IdentityUtil.getProperty(IdentityConstants.ServerConfig.SSO_DEFAULT_ASSERTION_ENCRYPTION_ALGORITHM).trim();
    } else {
        return IdentityApplicationConstants.XML.AssertionEncryptionAlgorithmURI.AES256;
    }
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:12,代码来源:IdentityApplicationManagementUtil.java

示例15: getKeyEncryptionAlgorithmURIByConfig

import org.wso2.carbon.identity.base.IdentityConstants; //导入依赖的package包/类
/**
 * @return the Key Encryption Algorithm URI defined in configuration
 */
public static String getKeyEncryptionAlgorithmURIByConfig() {
    if (StringUtils.isNotBlank(IdentityUtil.getProperty(IdentityConstants.ServerConfig
            .SSO_DEFAULT_KEY_ENCRYPTION_ALGORITHM))) {
        return IdentityUtil.getProperty(IdentityConstants.ServerConfig.SSO_DEFAULT_KEY_ENCRYPTION_ALGORITHM).trim();
    } else {
        return IdentityApplicationConstants.XML.KeyEncryptionAlgorithmURI.RSAOAEP;
    }
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:12,代码来源:IdentityApplicationManagementUtil.java


注:本文中的org.wso2.carbon.identity.base.IdentityConstants类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。