當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。