ClientAuthenticationFilter.java revision c29b77a9e8ee6009f6ceb8f91edb135796708ce5
/*
* DO NOT REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2012 ForgeRock Inc. All rights reserved.
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*/
/**
* Since this client authentication method involves a password, the
* authorization server MUST protect any endpoint utilizing it against brute
* force attacks.
*
* @see <a
* href="http://tools.ietf.org/html/draft-ietf-oauth-v2-24#section-2.3">2.3.
* Client Authentication</a>
*/
public class ClientAuthenticationFilter extends Authenticator {
private volatile ClientVerifier verifier;
super(context, true);
setMultiAuthenticating(false);
setOptional(true);
}
public ClientVerifier getVerifier() {
return verifier;
}
}
/**
* If the client type is confidential or the client was issued client
* credentials (or assigned other authentication requirements), the client
* MUST authenticate with the authorization server as described in Section
* 3.2.1.
*
* @param request
* @param response
* @return
* @see <a
* hrfe="http://tools.ietf.org/html/draft-ietf-oauth-v2-25#section-3.2.1"
* >3.2.1. Client Authentication</a>
*/
boolean result = false;
if (getVerifier() != null) {
try {
} else {
String.class);
}
} catch (OAuthProblemException e) {
// Todo Rechellenge the client
}
// TODO doError
}
result = true;
} else {
"Authentication failed. No verifier provided.");
}
return result;
}
}