OAuth2Component.java revision ec6f3779c641cb13f915072f87a5d11a6b74ba0c
/*
* 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]"
*/
/**
* This class can initialise the OAuth2 Endpoint. IT can be a Spring Bean or an
* OSGi component
*
* @author $author$
* @version $Revision$ $Date$
*/
public class OAuth2Component {
private ClientVerifier clientVerifier;
private Verifier userVerifier;
public OAuth2Provider getProvider() {
return provider;
}
}
if (null == configuration) {
}
return configuration;
}
this.configuration = configuration;
}
public ClientVerifier getClientVerifier() {
return clientVerifier;
}
this.clientVerifier = clientVerifier;
}
public Verifier getUserVerifier() {
return userVerifier;
}
this.userVerifier = userVerifier;
}
public OAuth2TokenStore getTokenStore() {
return tokenStore;
}
this.tokenStore = tokenStore;
}
// Define Resources directory
// Define Authorization Endpoint
.supportPassword();
// This endpoint protected by OpenAM Filter
// Define Token Endpoint
finder =
.supportPassword();
// Try to authenticate the client The verifier MUST set
}
// Configure context
}
return root;
}
public void deactivate() {
} else {
}
}
// 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; } } }
*/
}