Java Code Examples for sun.security.krb5.internal.Krb5#KRB_ERR_WRONG_REALM

The following examples show how to use sun.security.krb5.internal.Krb5#KRB_ERR_WRONG_REALM . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: KrbAsReqBuilder.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
boolean handleError(KrbException ke) throws RealmException {
    if (enabled) {
        if (ke.returnCode() == Krb5.KRB_ERR_WRONG_REALM) {
            Realm referredRealm = ke.getError().getClientRealm();
            if (req.getMessage().reqBody.kdcOptions.get(KDCOptions.CANONICALIZE) &&
                    referredRealm != null && referredRealm.toString().length() > 0 &&
                    count < Config.MAX_REFERRALS) {
                refCname = new PrincipalName(refCname.getNameType(),
                        refCname.getNameStrings(), referredRealm);
                refreshComm = true;
                count++;
                return true;
            }
        }
        if (count < Config.MAX_REFERRALS &&
                refCname.getNameType() != PrincipalName.KRB_NT_ENTERPRISE) {
            // Server may raise an error if CANONICALIZE is true.
            // Try CANONICALIZE false.
            enabled = false;
            return true;
        }
    }
    return false;
}
 
Example 2
Source File: KrbAsReqBuilder.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
boolean handleError(KrbException ke) throws RealmException {
    if (enabled) {
        if (ke.returnCode() == Krb5.KRB_ERR_WRONG_REALM) {
            Realm referredRealm = ke.getError().getClientRealm();
            if (req.getMessage().reqBody.kdcOptions.get(KDCOptions.CANONICALIZE) &&
                    referredRealm != null && referredRealm.toString().length() > 0 &&
                    count < Config.MAX_REFERRALS) {
                refCname = new PrincipalName(refCname.getNameType(),
                        refCname.getNameStrings(), referredRealm);
                refreshComm = true;
                count++;
                return true;
            }
        }
        if (count < Config.MAX_REFERRALS &&
                refCname.getNameType() != PrincipalName.KRB_NT_ENTERPRISE) {
            // Server may raise an error if CANONICALIZE is true.
            // Try CANONICALIZE false.
            enabled = false;
            return true;
        }
    }
    return false;
}
 
Example 3
Source File: KrbAsReqBuilder.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
boolean handleError(KrbException ke) throws RealmException {
    if (enabled) {
        if (ke.returnCode() == Krb5.KRB_ERR_WRONG_REALM) {
            Realm referredRealm = ke.getError().getClientRealm();
            if (req.getMessage().reqBody.kdcOptions.get(KDCOptions.CANONICALIZE) &&
                    referredRealm != null && referredRealm.toString().length() > 0 &&
                    count < Config.MAX_REFERRALS) {
                refCname = new PrincipalName(refCname.getNameType(),
                        refCname.getNameStrings(), referredRealm);
                refreshComm = true;
                count++;
                return true;
            }
        }
        if (count < Config.MAX_REFERRALS &&
                refCname.getNameType() != PrincipalName.KRB_NT_ENTERPRISE) {
            // Server may raise an error if CANONICALIZE is true.
            // Try CANONICALIZE false.
            enabled = false;
            return true;
        }
    }
    return false;
}
 
Example 4
Source File: KrbAsReqBuilder.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
boolean handleError(KrbException ke) throws RealmException {
    if (enabled) {
        if (ke.returnCode() == Krb5.KRB_ERR_WRONG_REALM) {
            Realm referredRealm = ke.getError().getClientRealm();
            if (req.getMessage().reqBody.kdcOptions.get(KDCOptions.CANONICALIZE) &&
                    referredRealm != null && referredRealm.toString().length() > 0 &&
                    count < Config.MAX_REFERRALS) {
                refCname = new PrincipalName(refCname.getNameType(),
                        refCname.getNameStrings(), referredRealm);
                refreshComm = true;
                count++;
                return true;
            }
        }
        if (count < Config.MAX_REFERRALS &&
                refCname.getNameType() != PrincipalName.KRB_NT_ENTERPRISE) {
            // Server may raise an error if CANONICALIZE is true.
            // Try CANONICALIZE false.
            enabled = false;
            return true;
        }
    }
    return false;
}