Microsoft O365 Introduction Part-1

What is Office 365? 

We have been using the Office Suite for quite a long time and it became an integral part of our daily work, especially in the corporate area, either in the form of Excel, PowerPoint or Word and so on. The latest version of Office that is available at the time of the writing this article is Office 2015. We are very familiar with Microsoft Office, but most of us do not know what Office 365 is.

It's been a while that Microsoft has been working on Office 365. After a beta test that began in October 2010, Office 365 was launched on June 28, 2011 as a successor to Microsoft Business Productivity Online Suite (MSBPOS), originally aimed at corporate users.

Now the question is, how is it different from Office 365?

Office 365 (sometimes refered to as O365) is the cloud implementation of Microsoft Office. Microsoft has moved our much known Office Suite to the cloud. Now we can access our files and do our work from anywhere, anytime using any device with internet access.

As the market of smart phones and tablets grow people have even begun using them for official work. With the power of Office 365 everything (Documents, Themes, Settings, Calendar and Email to name a few) will be synced across devices.

Let's see an example. A guy named Sam is working in a multinational company. His boss asks him to create a presentation and on the same day he is committed to go on a date with his girlfriend. He doesn't want to miss anything so he decides to complete the presentation before his date with his girlfriend. He opens his desktop and starts working. Somehow he completes the presentation but he didn't have time to review it, so he decides to save it and on the way, he plans to review the presentation. On the way, using his smartphone he begins reviewing the presentation that he had saved to the cloud using Office 365. Before reaching the venue he completes the review of the presentation and sends it to his boss but also enjoys his date.

Conclusion

Office 365 helped him to manage his work and personal life. With Office 365 you can work anywhere with every devices.

We can divide a cloud service into the following three categories:
  • IaaS: Infrastructure related stuff like virtual machines, virtual networks and so on fall under this category.

  • PaaS: In a Platform as a Service the vender provides a platform and does the maintenance. The user must publish and maintain their application.

  • SaaS: In Software as a Service, the vendor provides the software or an application that the user can use by logging into the application. Here the vender will maintain the application, the platform as well as the infrastructure like Office 365, the CRM is where Microsoft maintains the product for us.

Please check the following link for more information on IaaS, PaaS and SaaS: Microsoft Azure for Enterprises

Components of Cloud Computing

Office 365 is SaaS (Software as a service) implementation that uses the Microsoft cloud (Azure).



Advantages

The following are the main advantages of Office 365:

  • Access from anywhere any device.
  • Known platform in the cloud.
  • Secure and reliable.
  • Cost benefits “Pay as you go”.
  • Free from maintenance and updates.

Office 365 From a Developer's point of view

Previously you saw the general understanding of Office 365 and its uses. Now you will see from the developer's point of view. Office 365 is a SaaS implementation, it provides APIs to access various Office 365 services. The following are the services Office 365 provides:

  • Exchange Server
  • SharePoint online
  • SkyDrive
  • Yammer
  • Lync

We can integrate Office 365 into your application and use this service. Let's see a scenario where we can implement one of the Office 365 services.

Your boss has assigned the task to implement an online event management system where a presenter will present an event and attendees will subscribe and join the events. When the attendee subscribes for an event, he/she should receive an email as well as an event should be added to his/her calendar. Here you can use the exchange server's services and calendar service offered by Microsoft that is fully integrated with Office 365. This is pretty cool, isn't it? The attendee doesn't need to remember the event details and he/she can check it in the calendar.

We can do many things with these services, but one of the concerns is security. How is a user Authenticated and Authorized? The following section talks about these 2 main concepts.

Proceeding further, let's check the pre-requisites first as in the following:

  1. Visual Studio 2013 with Update 3 or later; I am using the Community Edition, it is free and has most of the features.

  2. Microsoft Office 365 API Tools version 1.4.50428.2.

  3. Office 365 account mapped with an Azure subscription. (Requires an Office 365 business and linked Azure subscription MSDN subscription enterprise/ultimate. For development we can create a trial Office 365 and create a linked Azure subscription).

  4. Knowledge of MVC though we will not use much of its features.

Let set up the Office 365 account

Go to Office 365 Dev Program and sign up for a new Office 365 account.



It will ask for your personal details and live id.

You also must link it to an Azure subscription. To activate an Azure subscription it will ask for your credit card details but the best part is Microsoft will not charge for the free trial subscription. These subscriptions will expire in one month.

For Authentication Office 365 uses 2-layer of filtration and for Authorization we must configure Office 365 services in the application and set the access levels.

Authentication

Let's see the following sequence diagram for authentication.



Authentication is the first step to access the Office 365 APIs and it has total 7 steps. Authentication is done using an Azure active directory. It has the two layers Authorization Endpoint and Token Endpoint. Let's see the entire flow one by one.

Step 1: When the user opens your website he/she will redirect to the Azure AD Authorization end points.

Step 2: Authorization endpoint sends a browser popup/redirect to the login.

Step 3: Once the user is verified in an Authorization Endpoint it sends an authentication code back to the user.

Step 4: Now the web application will use this code and request a Token Endpoint for the token.

Step 5: On success, the Token End point will return an Access token and refresh the token as a response.

Step 6: With the refresh Token and Access token the application will start using the Office 365 APIs.

Step 7: The API will start responding as a HTTP Response.

Authorization

Authorization is very important for an application because if we don't set any authorization, the application might provide access to all the services of Office 365 that may not be required. After setting up the authorization an application will use only the set resources. We can set the authorization using Visual Studio and the Azure Management Portal. The following is the procedure to add Authorization to an application using Visual Studio.

Note: The following is the procedure that gives the brief details of how to add Office 365 to our application. In the future series, I will provide a detailed procedure and we will create a working example. For now assume we have a hello world application that uses an Office 365 service.

Step 1

Open Visual Studio and create a web application project.

Step 2

Right-click on the project and Select Connected services. Here the user must login with their Office 365 credentials.





Step 3

Once the user has logged in successfully, the user can select the services and set their access level (read, read and write and so on). This will configure the application to use only those services and their access rights.



Once the user has set up the permission, the user will see something similar to the following:



Step 4

To save the settings click OK. It will add all the necessary packages and templates.

You can see the packages and DLLs being added in the Output window.



Once you see “Done” in the output window you can check the references window for the new packages added to the project.



This article rovided an introduction to Office 365, its Authentication and Authorization. In the next article I will show a demo application and the entire procedure required to implement it in an application. I will also the show implementation of the services one by one.

References

  1. Microsoft Virtual Academy

  2. Dev centers