OAuth2Component.java revision 073875d677d0cc89aa2cc1187c975225a2ead9d3
1670N/A * DO NOT REMOVE COPYRIGHT NOTICES OR THIS HEADER. 1670N/A * Copyright (c) 2012 ForgeRock Inc. All rights reserved. 1670N/A * The contents of this file are subject to the terms 1670N/A * of the Common Development and Distribution License 1670N/A * (the License). You may not use this file except in 1670N/A * compliance with the License. 1670N/A * You can obtain a copy of the License at 1670N/A * See the License for the specific language governing 1670N/A * permission and limitations under the License. 1670N/A * When distributing Covered Code, include this CDDL 1670N/A * Header Notice in each file and include the License file 1670N/A * If applicable, add the following below the CDDL Header, 1670N/A * with the fields enclosed by brackets [] replaced by 1670N/A * your own identifying information: 1670N/A * "Portions Copyrighted [2012] [ForgeRock Inc]" * This class can initialise the OAuth2 Endpoint. IT can be a Spring Bean or an * OSGi component. Used to test OAuth2 * @version $Revision$ $Date$ // Define Resources directory // Define Authorization Endpoint // This endpoint protected by OpenAM Filter // Try to authenticate the client The verifier MUST set // Null-Safe logger example * protected Logger getLogger(Context context) { Handler handler = new * Handler(context.getLogger()); Class[] interfacesArray = new * Class[]{Logger.class}; return (Logger) * Proxy.newProxyInstance(org.restlet. * engine.Engine.getInstance().getClassLoader(), interfacesArray, handler); * class Handler implements InvocationHandler { public Logger logger; * public Handler(Logger sum) { this.logger = sum; } * public Object invoke(Object proxy, Method method, Object[] args) throws * Throwable { if (null != logger) { return method.invoke(logger, args); } * else { return null; } } }