Accessing Onedrive For Business Files via REST api in something other than a .NET application? - rest

I apologize for my fundamental lack of knowledge in regards to these technologies in advance. I'm having a bit of trouble understanding the whole Azure AD/Authentication process in general, and I don't feel that Microsoft's support documents adequately describe much of the process.
I appears to me that the REST requests themselves are quite simple, and the following page seems to detail them quite well. https://msdn.microsoft.com/en-us/office/office365/api/files-rest-operations
However, what I fail to understand is the authentication process.
My goal here is to determine if what I'd like to do is even possible, so I will begin with that. What I need to be able to do is to be able to make REST API calls from a JSP or potentially a PHP script to access a link to a file located on a user's Onedrive for Business account. To put it simply, I would just like to be able to quickly get a publicly accessible link to a user's file. From the perspective of having access to the REST API, that seems to be a simple task, my challenge is understanding and implementing the capability to do so.
Correct me if I am wrong, but my current understanding of the process goes something like so.
Create an application in Azure AD, you need to define a location for signing on. I'm not certain how this works at all, does the defined location need to be making a request to sign on somehow? Does it need to exist on the same domain? I honestly have no idea the nature of how you actually go about signing in, but it requires some authentication of the application as well.
Once you have signed in, you have access to a 'security token' that has information about the application and what it can access. how is this token stored? A server session, browser cookies?
Somehow you pass this token along with your REST request and it is determined that you have access to the information you are requesting.
I have used pre-made JavaScript file pickers in the past to facilitate the selection of user files for things such as Google Drive and Dropbox, but it doesn't appear as though any such tools exist for Onedrive for Business, so I will need to become familiar with the authentication process myself. Looking into the Microsoft documentation has only served to confuse myself more, and unfortunately all of the examples are for .NET projects as far as I can tell. I am afraid that this means that is it only possible to access this information from a .NET project, but please correct me if this is not the case.
I realize that this question appears extremely ignorant, and that's likely because it is. Moving from JavaScript file pickers to something like this appears to be a significant leap in required technical prowess, and I'm still rather new, so please forgive my inexperience. Most importantly I'd like to know if what I'm looking to do is possible at all, and secondly if there are any readily available resources that are a little more focused than the Microsoft documentation.
Thanks in advance for any assistance.

There are some great resources available for coding for Office 365 and not just those on MSDN.
The best place to start is http://dev.office.com. This is the destination for information on O365 development. You can get to the documentation, training materials and code samples. The code samples have a filter so you can search on a number of properties including language and product. There are samples of course for .net, but also for iOS, Android and PHP, which is what you mention you want to use for your project.
http://dev.office.com/code-samples-detail/2138
This sample connects to the calendar, but the important part is understanding the authentication process for your application to Azure AD. Once you get the authentication working, you can call the other O365 services by getting the resource url to the appropriate resource from the Discovery Service.
If you need more samples, http://github.com/officedev is the place to look. These samples are from Microsoft, the community as well as the code used in Microsoft and community training events and presentations.
If you prefer, some great training courses exist on Microsoft Virtual Academy for Office 365 development. These are online videos that are broken into chapters and sections so you can easily find what you need. They often have labs associated with them as well. I recommend the Intro to Office 365 Development - Section 5 to get a quick overview of the Office 365 APIs and then look at the Deep Dive: Integrate Office 365 APIs in Your Web Apps.
If you still have questions, this is the place to post them. Hope this helps. Reply if you have any questions.

Related

Framework for educational site and forum with single database

I'm newbie in back-end development, that's why I want to start learning not from pure coding but choosing framework. Want to understand, how it works and start writing unique code by myself.
I've tried to choose framework basing on my future project and couldn't do it without the qualified help. I've searched before to write here, but couldn't find all I need. I don't ask for deep pieces of advice, manuals or so here. Hope, that you as more experienced can show me few ways and I'll choose the one by myself.
What I need to do with framework capabilities:
Forum:
one (or crossing) users' database with site
one header and footer for forum and site
changeble design themes (full CSS support)
groups' rights and design
user's rights and design
moderators, admins, plain users
forum sections, that could be nested
themes
visual post formatting
images inserting
symbols counting in posts
symbols counting for each user in theme
Site:
same to forum users, their groups and rights
user profile with settings
guest book
education module: timetable by user group, courses with lessons, homework sending/discussing, homework statuses, marks/journal of all users and user groups, educational statistics for user groups
public user profile with text form data and all marks, forum activity, statuses and other information
autoposting some data from user profile to forum and updating it when changing the profile
inactivation/activation/ban for user accounts
IP viewing for admins: can see, what users/forum's messages have the same IP
messenger: private chats, private and public chat groups, auto-adding users to chats by users' group
private user notes, that are visible only for admins
bonus accrual
store, when users can change bonuses for virtual goods and session of playing game for random gifts
visual map, where everyone can see all forum sections and what users are on them
plain newspaper: issues with structured articles (a la usual blog posts), commenting for users, offering article feature
I know, that it's so much, but project is mine. And it can be developing for a long time. If I need to study a year or few, it's okay.
How do you think, what frameworks have the most of modules for described functional? Please, don't argufy. Write here if you had experience (or you know somebody who had) of realising features, that're described above.
Programming language doesn't matter (because I'm noob in all of them), but I think about Ruby and PHP (and PHPBB forum). Others are ok too, if them can afford what I need.
Sorry if I unknowingly said something wrong. Tell me and I'll fix it.
Your wanting to build a lot for someone that knows nothing about any languages.
First you need to pick a platform/OS.. Windows or Unix/Linux?
From there, you can pick a Web Server to run on based on that OS.
Then that filters out what kind of language your going to write with.
EDIT:
When someone wants to be a mechanic, do they go to each mechanic shop and ask what is the best car to work on? Each mechanic would have a different answer. No one here, will be able to give you a non-bias answer. So here is what I like....
I write code in 18 languages and been have developed software for 25 years. I've written code for DOS, Windows, and Linux/Unix. Each language has it's own limitation and perfections, but I'm not a fan of open source and most Linux/Unix preferred languages even though some can run on Windows. I have a tendency to lean towards windows and enjoy back end development. I've written Web UIs in Angular, JSP, Java Spring Boot, WebFOCUS and ASP Classic. Now that you know more about me, here are my favorites.
I prefer Windows. I prefer C#. If I have to build a web UI, I prefer HTML 5/CSS3/Javascript with an ASP.NET/C# backend. I don't like bootstrap or jquery as I like to write with a small footprint as do most any older developer. The internet is full of garbage that isn't being used by most every site you go to, just so the developer can get a few shortcuts. Bootstrap and JQuery are just javascript libraries of which most sites can do what they want with 1/10 the code the client has to download, if they really knew Javascript.
There ya go, my bias opinion, take it or leave it, but most likely the only honest answer your going to get here.

Recommended way to perform operations on on-premises Exchange mail box

My question is related to the recommended way (going forward) to talk to on-premises Exchange mail box and perform operations on it from an external application programmatically?
EWS APIs and the corresponding SDKs look promising based on a few articles such as this :
https://blogs.msdn.microsoft.com/webdav_101/2018/06/19/about-using-ews-and-powershell/
but there is bit of confusion on whether it will continue to be supported in the future based on this:
https://blogs.technet.microsoft.com/exchange/2018/07/03/upcoming-changes-to-exchange-web-services-ews-api-for-office-365/
Although the above talks of just o365, the fact that EWS will no longer be invested in, raises the question if new applications for on-premises exchange should continue to use it.
PowerShell, remote PowerShell etc. also might work but it seems less suited for use/integration within an external application and more so for automating operations.
Could someone please throw some light on what is recommended way going forward to work with on-prem Exchange?
Try the Microsoft GraphAPI. Details https://developer.microsoft.com/en-us/graph/graph-explorer here. Sign in. Try the https://graph.microsoft.com/v1.0/me/messages sample. See more examples by clicking "Show More samples" on the left column after you login.
Is it The Way (tm)? I don't know but is very cool. I have some sample code I'm working with, nothing in a format to share, but look like the API covers a lot of territory. Some client-only rules look like they need some work to expose, maybe they'll get beefed up in later releases.
Depends on the type of Application you are trying to write, EWS is going to be around in Exchange 2019 so it will work just fine talking to say 2013, 16 and 19 OnPrem. There are advantages and disadvantages to using EWS vs. the new REST API's but it is application specific and changing fast. But again it depends entirely on the type of Application you are trying to write and what version of Exchange you need to support. And typically newer features that will appear in new OnPrem versions aren't back-ported into older versions. So a great new feature that will work in Office365 and Exchange 2019 may not work in 2016 and you may need to use some of the older legacy API's to achieve the same thing. Bottom line as of today if you are an ISV and need broad coverage support for versions of OnPrem Exchange expect to need to use both EWS and REST. If you are just creating apps for one organization that's going to be migrating to 2019 in the future you'll probably get away with just REST.

Webservice standards and DTDs

While brainstorming about six years ago, I had what I thought was a great idea: in the future there could be webservice standards and DTDs that effectively turn the web into a decentralized knowledgebase. I listed several areas where I thought this could be applied, one of which was:
For making data avail. directly from a business's website: open hours, locations, and contact phone numbers. Suggest a web service standard by which businesses have a standard URL extended off the main (base) URL for there website, at which is located a webservice. That webservice as well has a standardized set of services for downloading a list of their locations, contact telephone numbers, and business hours.
It's interesting looking back at these notes now since this is not how things have evolved. Instead of businesses putting this information on only their website then letting any search engine or other data aggregator to crawl it, they are updating it separately on their website, their Facebook page, and Google Maps. Facebook and Google Maps, due to their popularity, have become the solution to the problem I though my idea would solve.
Is the way things are better than the way I thought they could be? If so then why doesn't my idea fit the reality? If not then what's holding my idea back from being realized?
A lot of this information is available via APIs, that doesn't mean that it doesn't get put other places as well, through a variety of means. For example, a company may expose information via an API, and their Facebook app might use that API to populate a Facebook page.
Also, various microformats are in use that encapsulate some of this information.
The biggest obstacle is agreeing on what meta-information should be exposed, how it should be exposed, and how it should be accessed.

Can you extend Google Identity Toolkit to include facebook/twitter/etc?

I decided to look into using Google Identity Toolkit. I knew I liked the UI, and the idea of using a "federated" login system. I'm now having my doubts, as while my site works well with gmail/ymail/hotmail etc, it doesn't seem to support any of the social platforms.
Essentially, I just need an email address from people to be registered with the site, so I thought GITKit was the perfect solution.
Should I have gone down a custom route (like stackoverflow?), or have I missed some of the GITKit documentation?
Any help would be much appreciated.
I did do a fair amount of googling prior to posting that question. However, I have come accross some answers. Rather than delete my post - I guess I should share the information. If others thought the information was clear, please delete this thread!
Firstly, there is a page identifying how to add custom IDP's: https://sites.google.com/site/gitooldocs/customidps
There is also a sample site (http://www.openidsamplestore.com/localmapping/) which uses facebook.
How does the advanced demo work for identity providers who are not
E-mail providers, such as social networks?
The hardest part about
designing the advanced site was to find a way to handle all the
edge-cases that can happen with these types of identity providers.
Google previously published a summary of best-practices for
account-linking that describes why these types of identity providers
are so much harder to support. However this demo provides a user
self-service mechanism for all the tricky cases to avoid the costs
that a website might otherwise occur if those users contact a customer
support representative.
Finally, a best practices run-down is available here:
https://sites.google.com/site/oauthgoog/UXFedLogin/loginlogic
EDIT 1 :
If that identity provider asserts email addresses that it does not
host, we suggest you also implement additional account linking logic.
A future version of GITKit will add support for these type of
identity providers, such as social networks, which will avoid the need
to implement that logic
Perhaps GITKit is the future after-all... Would be nice to have an idea of the time-frame in which this support will be added though...
EDIT 2 :
Direct from the horses mouth (Eric Sachs # Google - Source Link):
That feature is not expected to be generally available in 2011. We
are shooting for Q1 2012
Looks like someone got it working back in Dec 2011 but there is still an outstanding issue with mapping the id returned to an email address. It was probably resolved:
https://groups.google.com/forum/#!searchin/google-identity-toolkit/facebook/google-identity-toolkit/2218yW4zXw8/28X7btJEh_sJ
Here is the documentation for the sample store including brief info on basic, mobile and advanced mode (using facebook):
https://sites.google.com/site/oauthgoog/Home/openidsamplesite
An out-of-the-box IDP for facebook and twitter has not yet been released.

Does there exist a robust Twilio enabled CMS with subscription management?

I've done quite a bit of searching for a CMS platform or robust framework that will perhaps facilitate the management of signup and subscriptions right of the box with a Twilio tie in.
Thus far I've only been successful at finding how many startups have been funded by the Twilio fund, who's building the nextgen voice enabled app, and various other things of that nature vs any real meat. Seems that there's a dearth of meaningful information without applying a plethora of negative google filters to reduce matches and even then it's still not giving anything real meaningful wrt my search.
So, I'm hoping that someone may have a better eye on the lay of the Twilio landscape as far as already existent systems go that can handle the bulk of needs that exist for a "regular" CMS esque site that needs to also handle subscriptions and e-commerce related tasks.
Hitherto I've just planned to build something out myself, but I wanted to do a sanity check before I spend a lot of time that could perhaps be obviated.
My suggestion would be to find a CMS that does everything you want (except the twilio links), on the platform you want, and then just add the Twilio stuff in. Twilio is simple to use, and should be simple to add-on to most open source CMS's. It'll probably be the easiest part of the project....