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


Java GSSContext.requestCredDeleg方法代码示例

本文整理汇总了Java中org.ietf.jgss.GSSContext.requestCredDeleg方法的典型用法代码示例。如果您正苦于以下问题:Java GSSContext.requestCredDeleg方法的具体用法?Java GSSContext.requestCredDeleg怎么用?Java GSSContext.requestCredDeleg使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.ietf.jgss.GSSContext的用法示例。


在下文中一共展示了GSSContext.requestCredDeleg方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: generateGSSToken

import org.ietf.jgss.GSSContext; //导入方法依赖的package包/类
protected byte[] generateGSSToken(
                                   final byte[] input,
                                   final Oid oid ) throws GSSException {

    byte[] token = input;
    if (token == null) {
        token = new byte[0];
    }
    GSSManager manager = getManager();

    GSSName serverName = manager.createName(servicePrincipalName, servicePrincipalOid);

    GSSContext gssContext = manager.createContext(serverName.canonicalize(oid),
                                                  oid,
                                                  null,
                                                  GSSContext.DEFAULT_LIFETIME);
    gssContext.requestMutualAuth(true);
    gssContext.requestCredDeleg(true);
    // Get client to login if not already done
    return gssClient.negotiate(gssContext, token);
}
 
开发者ID:Axway,项目名称:ats-framework,代码行数:22,代码来源:GGSSchemeBase.java

示例2: generateGSSToken

import org.ietf.jgss.GSSContext; //导入方法依赖的package包/类
/**
 * @since 4.4
 */
protected byte[] generateGSSToken(
        final byte[] input, final Oid oid, final String authServer,
        final Credentials credentials) throws GSSException {
    byte[] inputBuff = input;
    if (inputBuff == null) {
        inputBuff = new byte[0];
    }
    final GSSManager manager = getManager();
    final GSSName serverName = manager.createName(service + "@" + authServer, GSSName.NT_HOSTBASED_SERVICE);

    final GSSCredential gssCredential;
    if (credentials instanceof KerberosCredentials) {
        gssCredential = ((KerberosCredentials) credentials).getGSSCredential();
    } else {
        gssCredential = null;
    }

    final GSSContext gssContext = manager.createContext(
            serverName.canonicalize(oid), oid, gssCredential, GSSContext.DEFAULT_LIFETIME);
    gssContext.requestMutualAuth(true);
    gssContext.requestCredDeleg(true);
    return gssContext.initSecContext(inputBuff, 0, inputBuff.length);
}
 
开发者ID:MyPureCloud,项目名称:purecloud-iot,代码行数:27,代码来源:GGSSchemeBase.java

示例3: initGSS

import org.ietf.jgss.GSSContext; //导入方法依赖的package包/类
GSSContext initGSS() throws Exception {
    final GSSManager MANAGER = GSSManager.getInstance();

    final PrivilegedExceptionAction<GSSCredential> action = new PrivilegedExceptionAction<GSSCredential>() {
        @Override
        public GSSCredential run() throws GSSException {
            return MANAGER.createCredential(null, GSSCredential.DEFAULT_LIFETIME, KrbConstants.SPNEGO, GSSCredential.INITIATE_ONLY);
        }
    };

    final GSSCredential clientcreds = Subject.doAs(initiatorSubject, action);

    final GSSContext context = MANAGER.createContext(MANAGER.createName(acceptorPrincipal, GSSName.NT_USER_NAME, KrbConstants.SPNEGO),
            KrbConstants.SPNEGO, clientcreds, GSSContext.DEFAULT_LIFETIME);

    //TODO make configurable
    context.requestMutualAuth(true);
    context.requestConf(true);
    context.requestInteg(true);
    context.requestReplayDet(true);
    context.requestSequenceDet(true);
    context.requestCredDeleg(false);

    return context;
}
 
开发者ID:codecentric,项目名称:elasticsearch-shield-kerberos-realm,代码行数:26,代码来源:KerberizedClient.java

示例4: generateGSSToken

import org.ietf.jgss.GSSContext; //导入方法依赖的package包/类
protected byte[] generateGSSToken(
        final byte[] input, final Oid oid, final String authServer) throws GSSException {
    byte[] token = input;
    if (token == null) {
        token = new byte[0];
    }
    GSSManager manager = getManager();
    GSSName serverName = manager.createName("[email protected]" + authServer, GSSName.NT_HOSTBASED_SERVICE);
    GSSContext gssContext = manager.createContext(
            serverName.canonicalize(oid), oid, null, GSSContext.DEFAULT_LIFETIME);
    gssContext.requestMutualAuth(true);
    gssContext.requestCredDeleg(true);
    return gssContext.initSecContext(token, 0, token.length);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:15,代码来源:GGSSchemeBase.java

示例5: generateGSSToken

import org.ietf.jgss.GSSContext; //导入方法依赖的package包/类
protected byte[] generateGSSToken(
        final byte[] input, final Oid oid, final String authServer) throws GSSException {
    byte[] token = input;
    if (token == null) {
        token = new byte[0];
    }
    final GSSManager manager = getManager();
    final GSSName serverName = manager.createName("[email protected]" + authServer, GSSName.NT_HOSTBASED_SERVICE);
    final GSSContext gssContext = manager.createContext(
            serverName.canonicalize(oid), oid, null, GSSContext.DEFAULT_LIFETIME);
    gssContext.requestMutualAuth(true);
    gssContext.requestCredDeleg(true);
    return gssContext.initSecContext(token, 0, token.length);
}
 
开发者ID:reportportal,项目名称:client-java-httpclient-repacked,代码行数:15,代码来源:GGSSchemeBase.java

示例6: generateGSSToken

import org.ietf.jgss.GSSContext; //导入方法依赖的package包/类
@Override
protected byte[] generateGSSToken(final byte[] input, final Oid oid,
        final String authServer, final Credentials credentials)
        throws GSSException {
    byte[] inputBuff = input;
    if (inputBuff == null) {
        inputBuff = new byte[0];
    }
    final GSSManager manager = getManager();
    final GSSName serverName = manager.createName("[email protected]" + authServer,
            GSSName.NT_HOSTBASED_SERVICE);

    final GSSCredential gssCredential;
    if (credentials instanceof KerberosCredentials) {
        gssCredential = ((KerberosCredentials) credentials)
                .getGSSCredential();
    } else {
        gssCredential = null;
    }

    final GSSContext gssContext = manager.createContext(
            serverName.canonicalize(oid), oid, gssCredential,
            GSSContext.DEFAULT_LIFETIME);
    gssContext.requestMutualAuth(true);
    gssContext.requestCredDeleg(true);
    return gssContext.initSecContext(inputBuff, 0, inputBuff.length);
}
 
开发者ID:johrstrom,项目名称:cloud-meter,代码行数:28,代码来源:FixedSPNegoScheme.java


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