mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-10-31 17:25:58 +01:00
Do not base64 twice in SASL X-OAUTH2
Fixes SMACK-722.
This commit is contained in:
parent
b8d9c38a39
commit
1f87185ee8
1 changed files with 3 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright 2014-2015 Florian Schmaus
|
||||
* Copyright 2014-2016 Florian Schmaus
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -20,7 +20,6 @@ import javax.security.auth.callback.CallbackHandler;
|
|||
|
||||
import org.jivesoftware.smack.SmackException;
|
||||
import org.jivesoftware.smack.sasl.SASLMechanism;
|
||||
import org.jivesoftware.smack.util.stringencoder.Base64;
|
||||
|
||||
/**
|
||||
* The SASL X-OAUTH2 mechanism as described in <a
|
||||
|
@ -72,8 +71,8 @@ public class SASLXOauth2Mechanism extends SASLMechanism {
|
|||
|
||||
@Override
|
||||
protected byte[] getAuthenticationText() throws SmackException {
|
||||
// base64("\0" + user_name + "\0" + oauth_token)
|
||||
return Base64.encode(toBytes('\u0000' + authenticationId + '\u0000' + password));
|
||||
// Note that base64 encoding is done in SASLMechanism for the bytes return by getAuthenticationText().
|
||||
return toBytes('\u0000' + authenticationId + '\u0000' + password);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue