/*
 * Decompiled with CFR 0.152.
 */
package org.jivesoftware.smack.sasl.core;

import javax.security.auth.callback.CallbackHandler;
import org.jivesoftware.smack.SmackException;
import org.jivesoftware.smack.sasl.SASLMechanism;
import org.jivesoftware.smack.util.stringencoder.Base64;

public class SASLXOauth2Mechanism
extends SASLMechanism {
    public static final String NAME = "X-OAUTH2";

    @Override
    protected void authenticateInternal(CallbackHandler cbh) throws SmackException {
        throw new UnsupportedOperationException("CallbackHandler not (yet) supported");
    }

    @Override
    protected byte[] getAuthenticationText() throws SmackException {
        return Base64.encode(SASLXOauth2Mechanism.toBytes('\u0000' + this.authenticationId + '\u0000' + this.password));
    }

    @Override
    public String getName() {
        return NAME;
    }

    @Override
    public int getPriority() {
        return 410;
    }

    @Override
    public SASLXOauth2Mechanism newInstance() {
        return new SASLXOauth2Mechanism();
    }

    @Override
    public void checkIfSuccessfulOrThrow() throws SmackException {
    }
}
