Forum Discussion
Server side printing
Sabbadino2 To use the Print API from Microsoft Graph, you will need the user's token. This user should have access to Universal Print and the printer to which print job is being redirected to. For reference, please check out:
- Video - https://aka.ms/upbuildvideo
- Code Sample - https://aka.ms/upsample
- Graph API docs - https://docs.microsoft.com/graph/api/resources/printjob?view=graph-rest-beta
Hope this helps.
Thx, Saurabh
Does a b2c user token works ? Or a b2b AD user token is needed ?
Our application must support different identity providers, does setting up a shared AD user and getting a token via ropc flow will work ?
Thank you.
Enrico
- Jimmy_WuAug 07, 2020
Microsoft
Sabbadino2, if I understand your scenario correctly, you are developing an app that is able to connect to different identity providers, one of which is AAD. Universal Print currently only support AAD user tokens. So, how I currently see the application working is the following:
- App prompts user for the AAD user credentials to retrieve user's AAD access token
- App uses the user's AAD access token to call Universal Print Graph APIs
Regarding B2B AAD user account support, if the AAD tenant is configured to support B2B user accounts and the B2B user account has been issued a license for Universal Print, along with corresponding printer permissions, then using the B2B user's AAD access token should work.
HTH,
Jimmy
- Sabbadino2Aug 07, 2020Copper ContributorHi Jimmy, thank you for your reply. My question was actually about b2c users.
My other question is related to the fact that openidconnect specs allows to get a user token using the ropc flow (server to server flow) in addition to the standard browser based flow. I wonder if a token obtained in this way will work; we cannot ask the user to login once in our application using our identity provider and then again to azure and to get a user token to print.
If a token obtained from ropc flow works, we could setup a single azure ad user and use it to do all the printing.
Thank you, enrico- Saurabh_BansalAug 07, 2020
Microsoft
Sabbadino2 we havent validated if the b2c tokens work. In the current version, Universal Print is enabled for users who directly login and get their access token via Azure AD.
Thanks,
Saurabh