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:
- Link to Graph OneNote endpoin
- Link to OneNote ClassNotebooks endpoint
- Link to OneNote StaffNotebooks endpoint
- 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
andNotes.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
https://graph.microsoft.com/beta/me/onenote/notebooks
. The issue is the information that I am lacking can be obtained from sayhttps://www.onenote.com/api/v1.0/me/notes/classnotebooks
. I don't think SDK has a fix for this scenario. – iiminov