0
votes

I am trying to remove dependence on adal.js and adal-angular.js from my project as the CMS I am using already provides support Azure authentication.

I did a bit of work to update the login provider to v2.0:

https://login.microsoftonline.com/common/oauth2/v2.0/authorize
https://login.microsoftonline.com/common/oauth2/v2.0/token

This allowed me to leverage Graph API. While I can access OneNote notebooks:

https://graph.microsoft.com/beta/me/onenote/notebooks

I find myself lacking the ability to distinguish between personal, class and staff notebooks.

https://www.onenote.com/api/v1.0/me/notes/classnotebooks
https://www.onenote.com/api/v1.0/me/notes/staffnotebooks

I am also lacking the ability to see/manage members (teachers, students, leaders, members respectively).

Prior to the update, I used an angular code example to test OneNote API and integration. But the main issue was that I had to use adal to obtain an access token. In other words, the user was forced to log in a second time despite already being signed in in order to use OneNote component. And I was hoping to do away with this extra step.

As per title, I am looking for a way to use the access/refresh token(s) obtained from Azure v2.0 auth process to silently exchange/obtain OneNote access token.

Is it even possible? And if not is there a more user-friendly workaround?

Reference:

  1. Link to Graph OneNote endpoin
  2. Link to OneNote ClassNotebooks endpoint
  3. Link to OneNote StaffNotebooks endpoint
  4. I am looking at this and think to myself why was the OneNote API not working for me before I switched to Azure v2.0? I have the right scopes too Notes.Read and Notes.Create.

ps: If I had all the necessary endpoints in Graph OneNote API I would not bother with OneNote API.

pss: In case this is of importance the front end is implemented using AngularJS which in turn leverages Graph API using Web API framework.

psss: To get a better idea of what I am talking about here a link to Graph Explorer

1
Are you using the Graph SDK or pure rest calls?Marco
Basic rest calls. Graph SDK didn't work for me, unfortunately. Does Graph SDK offer more functionality when it comes to OneNote endpoints?iiminov
The SDK has quiet a few examples, where a TokenCache stores that token, which is then used to access all information, based on scopes.Marco
From my understanding, SDK is just a fancy abstraction library which is handy if you don't want to mess around with something like HttpClient to make rest calls.iiminov
I don't have trouble accessing information under say https://graph.microsoft.com/beta/me/onenote/notebooks. The issue is the information that I am lacking can be obtained from say https://www.onenote.com/api/v1.0/me/notes/classnotebooks. I don't think SDK has a fix for this scenario.iiminov

1 Answers

0
votes

Sorry but the OneNote ClassNotebooks and StaffNotebooks endpoints are not yet supported in Microsoft Graph. But it is in the plans, so we will let you know when it is ready

Also, currently it is not possible to use the Azure v2.0 token for OneNote API endpoints.