Tuesday 10 May 2016

How to get an authentication from Box using mulesoft.

Authenticate to Box using mulesoft.


 <http:listener-config name="HTTP_Listener_Configuration" host="0.0.0.0" port="8081" doc:name="HTTP Listener Configuration"/>
    <box:config name="Box" clientId="05zpeboxxfms6fo7805izrxff9dwbc74" clientSecret="LVD5juoF7ookFVn4uN69Pco3NI4EQeE0" doc:name="Box">
        <box:oauth-callback-config domain="localhost" localPort="8082" remotePort="8082" path="callback" />
    </box:config>
    <objectstore:config name="ObjectStore" objectStore-ref="_defaultInMemoryObjectStore" doc:name="ObjectStore: Configuration" />
    <flow name="boxAuthenticationFlow">
        <http:listener config-ref="HTTP_Listener_Configuration" path="/auth" doc:name="HTTP"/>
        <box:authorize config-ref="Box" doc:name="Box-Authorize"  />
        <set-payload value="#[flowVars._oauthVerifier]" doc:name="Set Payload"/>
        <logger message="#[payload]" level="INFO" doc:name="Logger"/>
        <box:create-folder config-ref="Box" folderName="test folder" doc:name="Box"/>
    </flow>