Package org.mule.security.oauth

Examples of org.mule.security.oauth.OAuth1Adapter


    @Override
    public void start() throws MuleException
    {
        super.start();
        OAuth1Adapter moduleObject = this.getAdapter();
        OAuth1Manager manager = moduleObject.getOauth1Manager();
        OAuth1FetchAccessTokenMessageProcessor fetchAccessTokenMessageProcessor = new OAuth1FetchAccessTokenMessageProcessor(
            moduleObject);

        if (this.getAccessTokenUrl() != null)
        {
            fetchAccessTokenMessageProcessor.setAccessTokenUrl(this.getAccessTokenUrl());
        }
        else
        {
            fetchAccessTokenMessageProcessor.setAccessTokenUrl(moduleObject.getAccessTokenUrl());
        }

        if (requestTokenUrl != null)
        {
            fetchAccessTokenMessageProcessor.setRequestTokenUrl(requestTokenUrl);
        }
        else
        {
            fetchAccessTokenMessageProcessor.setRequestTokenUrl(moduleObject.getRequestTokenUrl());
        }

        if (this.getAuthorizationUrl() != null)
        {
            fetchAccessTokenMessageProcessor.setAuthorizationUrl(this.getAuthorizationUrl());
        }
        else
        {
            fetchAccessTokenMessageProcessor.setAuthorizationUrl(moduleObject.getAuthorizationUrl());
        }

        this.startCallback(manager, fetchAccessTokenMessageProcessor);
    }
View Full Code Here


     * @param event MuleEvent to be processed
     * @throws MuleException
     */
    protected final MuleEvent doProcess(MuleEvent event) throws Exception
    {
        OAuth1Adapter moduleObject = this.getAdapter();
        Map<String, String> extraParameters = new HashMap<String, String>();

        if (this.getState() != null)
        {
            extraParameters.put("state", this.toString(event, this.getState()));
        }

        moduleObject.setAccessTokenUrl(this.toString(event, this.getAccessTokenUrl()));

        String location = moduleObject.authorize(extraParameters, requestTokenUrl, this.getAccessTokenUrl(),
            this.getAuthorizationUrl(), this.getOauthCallback().getUrl());

        this.notifyAuthorizeStart(event);

        event.getMessage().setOutboundProperty(OAuthProperties.HTTP_STATUS, "302");
View Full Code Here

     * @throws Exception
     */
    @Override
    protected MuleEvent doProcess(MuleEvent event) throws Exception
    {
        OAuth1Adapter adapter = this.getAdapter();
        adapter.reset();

        return event;
    }
View Full Code Here

TOP

Related Classes of org.mule.security.oauth.OAuth1Adapter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.