mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-12-05 18:41:11 +01:00
Big change for authentication, which now supports more SASL mechanisms and
callbacks. This should address issues SMACK-210 and SMACK-142, as well as set the stage for SMACK-234. git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@9498 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
85a92b600b
commit
13b8d313ba
14 changed files with 801 additions and 189 deletions
|
|
@ -1,5 +1,4 @@
|
|||
/**
|
||||
* Copyright 2003-2007 Jive Software.
|
||||
*
|
||||
* All rights reserved. Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -19,11 +18,9 @@ package org.jivesoftware.smack.sasl;
|
|||
import org.jivesoftware.smack.SASLAuthentication;
|
||||
|
||||
/**
|
||||
* Implementation of the SASL PLAIN mechanisn as defined by the
|
||||
* <a href="http://www.ietf.org/internet-drafts/draft-ietf-sasl-plain-08.txt">IETF draft
|
||||
* document</a>.
|
||||
* Implementation of the SASL PLAIN mechanism
|
||||
*
|
||||
* @author Gaston Dombiak
|
||||
* @author Jay Kline
|
||||
*/
|
||||
public class SASLPlainMechanism extends SASLMechanism {
|
||||
|
||||
|
|
@ -34,23 +31,4 @@ public class SASLPlainMechanism extends SASLMechanism {
|
|||
protected String getName() {
|
||||
return "PLAIN";
|
||||
}
|
||||
|
||||
protected String getAuthenticationText(String username, String host, String password) {
|
||||
// Build the text containing the "authorization identity" + NUL char +
|
||||
// "authentication identity" + NUL char + "clear-text password"
|
||||
StringBuilder text = new StringBuilder();
|
||||
// Commented out line below due to SMACK-224. This part of PLAIN auth seems to be
|
||||
// optional, and just removing it should increase compatability.
|
||||
// text.append(username).append("@").append(host);
|
||||
text.append('\0');
|
||||
text.append(username);
|
||||
text.append('\0');
|
||||
text.append(password);
|
||||
return text.toString();
|
||||
}
|
||||
|
||||
protected String getChallengeResponse(byte[] bytes) {
|
||||
// Return null since this mechanism will never get a challenge from the server
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue