wso2 esb capabilities to one drive - mitra microsoft ... · wso2 technologies – we wanted to...

7
www.mitrai.com WHITE PAPER Extending WSO2 ESB Capabilities to One Drive - Mitra Innovation builds a Microsoft OneDrive connector

Upload: others

Post on 14-Jul-2020

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: WSO2 ESB Capabilities to One Drive - Mitra Microsoft ... · WSO2 technologies – we wanted to avoid creating additional development overheads by implementing a WSO2 ESB connector

www.mitrai.com

WHITE PAPER

Extending WSO2 ESB Capabilities to One Drive - Mitra Innovation builds a Microsoft OneDrive connector

Page 2: WSO2 ESB Capabilities to One Drive - Mitra Microsoft ... · WSO2 technologies – we wanted to avoid creating additional development overheads by implementing a WSO2 ESB connector

www.mitrai.com

Page 2

Microsoft OneDrive has come a long way since its launch as Windows Live Folders with the code name ‘SkyDrive’ in 2007. Its technology has steadily been

improved upon for over a decade, allowing it to evolve into one of the leading file hosting services. Today, OneDrive offers a wealth of powerful features and

apps for more platforms than any of its competitors.

One of the key factors of OneDrive is its interoperability with various web services,

and Microsoft’s introduction of OneDrive APIs has enabled developers to develop

web services and client apps, harnessing OneDrive’s cloud storage. The API’s include

a Software Development Kit (SDK) for .NET, Android, IOS and a RESTFul services

layer for applications. This SDK empowers client applications to use a versatile,

cloud based file hosting system which allows users of these web services and

client apps to browse, view, upload or edit files stored on OneDrive.

The beauty of OneDrive

Recently, one of our customers required a file management solution in a cloud

based environment. They wanted to use Microsoft OneDrive as the file hosting

environment, in order to leverage their existing OneDrive business account.

Our client already had WSO2 ESB deployed and configured, and this served as their integration backbone. As their solution provider – and an expert in

WSO2 technologies – we wanted to avoid creating additional development overheads by implementing a WSO2 ESB connector solution that does not need

the (proprietary) OneDrive API implementation for their applications.

Mitra Innovation, Microsoft OneDrive and WSO2 ESB

The API includes a SDK for .NET, Androd,

IOS and a RESTFul services layer for

applications.

This empowers client applications to use a

versatile, cloud based file hosting system

““

Page 3: WSO2 ESB Capabilities to One Drive - Mitra Microsoft ... · WSO2 technologies – we wanted to avoid creating additional development overheads by implementing a WSO2 ESB connector

www.mitrai.com

Page 3

When it comes to WSO2 ESB, the most well-known method of connecting to third party services is through ‘connectors’. The WSO2 store provides a wide

range of connectors, however, at this particular point in time, a Microsoft OneDrive connector wasn’t available. As innovation is the lifeblood and

competitive advantage of our business at Mitra Innovation, we decided to build the connector ourselves, in order to meet our client’s needs.

When developing the OneDrive connector, we wanted to create something that would allow our client – and future users – to connect seamlessly to their

OneDrive,

without having to implement the tedious tasks of authenticating or authorising access each time OneDrive is accessed.

In addition, we had to ensure that every connector that is already implemented, or will be implemented will perform the following tasks:

Easy to configure – once for each client, or once for all clients that subscribe

The ability to be extended or modified easily in cases of updates to OneDrive API.

While keeping the basic design considerations in mind, we also requested the following capabilities of the API to be exposed via the WSO2 ESB:

To upload documents to the specified folder of the OneDrive instance

To search for documents inside a particular folder

To download documents providing its name.

Connectors

Our approach when developing the OneDrive connector

Page 4: WSO2 ESB Capabilities to One Drive - Mitra Microsoft ... · WSO2 technologies – we wanted to avoid creating additional development overheads by implementing a WSO2 ESB connector

www.mitrai.com

Page 4

The image below provides an overview of the solution we developed:

For each of the requests, the WSO2 ESB generates the access token and authorisation based on the configuration information provided in the ‘init’ method of

the connector. The configuration (‘init’ method) expects the following information:

• Application / Client id

• Client secret

• Authorisation code.

Please refer to the OneDrive API docs for more information on how to use the API (https://dev.onedrive.com/).

Page 5: WSO2 ESB Capabilities to One Drive - Mitra Microsoft ... · WSO2 technologies – we wanted to avoid creating additional development overheads by implementing a WSO2 ESB connector

www.mitrai.com

Page 5

The following is a sample API configuration that makes use of the connector methods to search for documents in a given folder.

<inSequence>

<onecloud.initWithAuthCode>

<apiUrl>https://api.onedrive.com/v1.0</apiUrl>

<clientId>your client id</clientId>

<clientSecret>your client Secretf</clientSecret>

<redirectUri>redirect url</redirectUri>

<authCode>your auth code</authCode>

</onecloud.initWithAuthCode>

<property name=”uri.var.accessToken”

expression=”get-property(‘operation’,’retrieved-accessToken’)”

scope=”default”

type=”STRING”/>

<header name=”Authorization”

scope=”transport”

expression=”fn:concat (‘Bearer’, $ctx:uri.var.accessToken)”/>

<onecloud.searchFiles>

<apiUrl>https://api.onedrive.com</apiUrl>

<folderName>temp</folderName>

<fileName>{$ctx:query.param.q}</fileName>

<selectFields>,name</selectFields>

<numRows>10</numRows>

</onecloud.searchFiles>

</inSequence>

Page 6: WSO2 ESB Capabilities to One Drive - Mitra Microsoft ... · WSO2 technologies – we wanted to avoid creating additional development overheads by implementing a WSO2 ESB connector

www.mitrai.com

Page 6

The Outcome

Mitra Innovation and WSO2

Mitra Innovation has been very successful in developing the OneDrive Connector for WSO2 ESB, and not only have we offered great value to our customer

whilst solving their problem, but we have also shared our solution by donating it back to the WSO2 ESB OpenSource community.

If you’re looking for a good WSO2 ESB connector for Microsoft OneDrive, we hope you’ve found this document, and our development work, useful. We hope

to share more connectors in the future.

If you need support integrating the OneDrive connector or to develop connectors to other proprietary systems, please get in touch with us at innovate@

mitrai.com (or visit our website at www.mitrai.com). We’d be happy to help.

Mitra Innovation is a Preferred Partner of WSO2 as we are well versed in various WSO2

technologies, and we have developed our business to incorporate these skills. We believe

that entrepreneurs and enterprises should capitalise on WSO2 middleware capabilities in

order to launch new ventures or implement great ideas faster and cheaper. We are happy

to provide all organisations with WSO2 guidance, support and integration work, wherever

necessary.

We recommend the use of WSO2 middleware because it is a 100% open

source platform which spans the entire length and breadth of service

orientated architecture (SOA).

“ “

Page 7: WSO2 ESB Capabilities to One Drive - Mitra Microsoft ... · WSO2 technologies – we wanted to avoid creating additional development overheads by implementing a WSO2 ESB connector

Would you like to know more?Get in touch today!

OFFICES IN: UK | AUSTRALIA | SRI LANKA

[email protected] | +44 (0) 203 908 1977 | www.mitrai.com

Mitra Innovation is passionate about helping smart entrepreneurs, enterprises and public service organisations to accelerate innovative ideas into amazing global businesses or solutions.

We are specialists in product incubation, digital transformation, and Cloud-to-Cloud systems integration, with expertise in WSO2 and AWS technologies.

Think Integration. Think Incubation. Think Innovation. THINK MITRA