src/com/isode/stroke/sasl/ClientAuthenticator.java
changeset 1015 63669480c941
child 1018 8daca77fabc1
equal deleted inserted replaced
1014:5d3c8519d297 1015:63669480c941
       
     1 /*
       
     2  * Copyright (c) 2010, Isode Limited, London, England.
       
     3  * All rights reserved.
       
     4  */
       
     5 /*
       
     6  * Copyright (c) 2010, Remko Tron¨on.
       
     7  * All rights reserved.
       
     8  */
       
     9 package com.isode.stroke.sasl;
       
    10 
       
    11 import com.isode.stroke.base.ByteArray;
       
    12 
       
    13 public abstract class ClientAuthenticator {
       
    14 
       
    15     public ClientAuthenticator(String name) {
       
    16         this.name = name;
       
    17     }
       
    18 
       
    19     public String getName() {
       
    20         return name;
       
    21     }
       
    22 
       
    23     public void setCredentials(String authcid, String password) {
       
    24         setCredentials(authcid, password, "");
       
    25     }
       
    26 
       
    27     public void setCredentials(String authcid, String password, String authzid) {
       
    28         this.authcid = authcid;
       
    29         this.password = password;
       
    30         this.authzid = authzid;
       
    31     }
       
    32 
       
    33     public abstract ByteArray getResponse();
       
    34 
       
    35     public abstract boolean setChallenge(ByteArray challenge);
       
    36 
       
    37     public String getAuthenticationID() {
       
    38         return authcid;
       
    39     }
       
    40 
       
    41     public String getAuthorizationID() {
       
    42         return authzid;
       
    43     }
       
    44 
       
    45     public String getPassword() {
       
    46         return password;
       
    47     }
       
    48     private String name;
       
    49     private String authcid;
       
    50     private String password;
       
    51     private String authzid;
       
    52 }