OpenAMResourceOwnerAuthenticator.java revision 5db031755ab3a8762e266f96f5d74832548d330b
/*
* 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 legal/CDDLv1.0.txt. See the License for the
* specific language governing permission and limitations under the License.
*
* When distributing Covered Software, include this CDDL Header Notice in each file and include
* the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2014-2015 ForgeRock AS.
*/
/**
* Authenticates a resource owner from the credentials provided on the request.
*
* @since 12.0.0
*/
public class OpenAMResourceOwnerAuthenticator implements ResourceOwnerAuthenticator {
private final RealmNormaliser realmNormaliser;
/**
* Constructs a new OpenAMResourceOwnerAuthenticator.
*
* @param realmNormaliser An instance of the RealmNormaliser.
*/
this.realmNormaliser = realmNormaliser;
}
/**
* {@inheritDoc}
*/
public ResourceOwner authenticate(OAuth2Request request, boolean useSession) throws NotFoundException {
try {
} catch (Exception e){
}
final String realm = realmNormaliser.normalise(request.<String>getParameter(OAuth2Constants.Custom.REALM));
} else {
try {
} catch (SSOException e) {
} catch (ParseException e) {
} catch (IdRepoException e) {
}
}
return null;
}
private ResourceOwner authenticate(String username, char[] password, String realm, String service) {
try {
lc.login(AuthContext.IndexType.SERVICE, service, null, ServletUtils.getRequest(Request.getCurrent()),
} else {
lc.login(ServletUtils.getRequest(Request.getCurrent()), ServletUtils.getResponse(Response.getCurrent()));
}
while (lc.hasMoreRequirements()) {
// loop through the requires setting the needs..
if (callbacks[i] instanceof NameCallback) {
} else if (callbacks[i] instanceof PasswordCallback) {
} else {
}
}
// there's missing requirements not filled by this
}
}
// validate the password..
try {
// package up the token for transport..
} catch (Exception e) {
// we're going to throw a generic error
// because the system is likely down..
}
}
} catch (AuthLoginException le) {
} finally {
try {
} catch (AuthLoginException e) {
}
}
}
return ret;
}
}
}