Server side printing

%3CLINGO-SUB%20id%3D%22lingo-sub-1560961%22%20slang%3D%22en-US%22%3EServer%20side%20printing%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1560961%22%20slang%3D%22en-US%22%3EHi%2C%20I%20watched%20a%20video%20showing%20how%20to%20do%20print%20a%20job%20from%20server%20side%20using%20graph%20API.%3CBR%20%2F%3EHow%20does%20server%20side%20print%20is%20related%20to%20user%20365%20licenses%20%3F%20Can%20I%20call%20graph%20API%20to%20print%20using%20a%20client%20credential%20token%20%3F%3CBR%20%2F%3ECan%20I%20print%20using%20a%20jwt%20token%20obtained%20from%20a%20b2c%20domain%20%3F%3CBR%20%2F%3E%3CBR%20%2F%3EThank%20you%3CBR%20%2F%3EEnrico%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1562269%22%20slang%3D%22en-US%22%3ERe%3A%20Server%20side%20printing%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1562269%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F451638%22%20target%3D%22_blank%22%3E%40Sabbadino2%3C%2FA%3E%26nbsp%3BTo%20use%20the%20Print%20API%20from%20Microsoft%20Graph%2C%20you%20will%20need%20the%20user's%20token.%20This%20user%20should%20have%20access%20to%20Universal%20Print%20and%20the%20printer%20to%20which%20print%20job%20is%20being%20redirected%20to.%20For%20reference%2C%20please%20check%20out%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EVideo%20-%20%3CA%20href%3D%22https%3A%2F%2Faka.ms%2Fupbuildvideo%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Faka.ms%2Fupbuildvideo%3C%2FA%3E%26nbsp%3B%3C%2FLI%3E%0A%3CLI%3ECode%20Sample%20-%20%3CA%20href%3D%22https%3A%2F%2Faka.ms%2Fupsample%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Faka.ms%2Fupsample%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3EGraph%20API%20docs%20-%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fgraph%2Fapi%2Fresources%2Fprintjob%3Fview%3Dgraph-rest-beta%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fgraph%2Fapi%2Fresources%2Fprintjob%3Fview%3Dgraph-rest-beta%3C%2FA%3E%26nbsp%3B%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EHope%20this%20helps.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThx%2C%20Saurabh%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1562288%22%20slang%3D%22en-US%22%3ERe%3A%20Server%20side%20printing%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1562288%22%20slang%3D%22en-US%22%3EHi%2C%20thank%20you%20for%20your%20answer.%3CBR%20%2F%3E%3CBR%20%2F%3EDoes%20a%20b2c%20user%20token%20works%20%3F%20Or%20a%20b2b%20AD%20user%20token%20is%20needed%20%3F%3CBR%20%2F%3EOur%20application%20must%20support%20different%20identity%20providers%2C%20does%20setting%20up%20a%20shared%20AD%20user%20and%20getting%20a%20token%20via%20ropc%20flow%20will%20work%20%3F%3CBR%20%2F%3EThank%20you.%3CBR%20%2F%3EEnrico%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1572054%22%20slang%3D%22en-US%22%3ERe%3A%20Server%20side%20printing%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1572054%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F451638%22%20target%3D%22_blank%22%3E%40Sabbadino2%3C%2FA%3E%2C%26nbsp%3Bif%20I%20understand%20your%20scenario%20correctly%2C%20you%20are%20developing%20an%20app%20that%20is%20able%20to%20connect%20to%20different%20identity%20providers%2C%20one%20of%20which%20is%20AAD.%26nbsp%3B%20Universal%20Print%20currently%20only%20support%20AAD%20user%20tokens.%26nbsp%3B%20So%2C%20how%20I%20currently%20see%20the%20application%20working%20is%20the%20following%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EApp%20prompts%20user%20for%20the%20AAD%20user%20credentials%20to%20retrieve%20user's%20AAD%20access%20token%3C%2FLI%3E%0A%3CLI%3EApp%20uses%20the%20user's%20AAD%20access%20token%20to%20call%20Universal%20Print%20Graph%20APIs%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ERegarding%20B2B%20AAD%20user%20account%20support%2C%20if%20the%20AAD%20tenant%20is%20configured%20to%20support%20B2B%20user%20accounts%20and%20the%20B2B%20user%20account%20has%20been%20issued%20a%20license%20for%20Universal%20Print%2C%20along%20with%20corresponding%20printer%20permissions%2C%20then%20using%20the%20B2B%20user's%20AAD%20access%20token%20should%20work.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHTH%2C%3C%2FP%3E%0A%3CP%3EJimmy%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1572705%22%20slang%3D%22en-US%22%3ERe%3A%20Server%20side%20printing%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1572705%22%20slang%3D%22en-US%22%3EHi%20Jimmy%2C%20thank%20you%20for%20your%20reply.%20My%20question%20was%20actually%20about%20b2c%20users.%3CBR%20%2F%3E%3CBR%20%2F%3EMy%20other%20question%20is%20related%20to%20the%20fact%20that%20openidconnect%20specs%20allows%20to%20get%20a%20user%20token%20using%20the%20ropc%20flow%20(server%20to%20server%20flow)%20in%20addition%20to%20the%20standard%20browser%20based%20flow.%20I%20wonder%20if%20a%20token%20obtained%20in%20this%20way%20will%20work%3B%20we%20cannot%20ask%20the%20user%20to%20login%20once%20in%20our%20application%20using%20our%20identity%20provider%20and%20then%20again%20to%20azure%20and%20to%20get%20a%20user%20token%20to%20print.%3CBR%20%2F%3EIf%20a%20token%20obtained%20from%20ropc%20flow%20works%2C%20we%20could%20setup%20a%20single%20azure%20ad%20user%20and%20use%20it%20to%20do%20all%20the%20printing.%3CBR%20%2F%3EThank%20you%2C%20enrico%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1573334%22%20slang%3D%22en-US%22%3ERe%3A%20Server%20side%20printing%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1573334%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F451638%22%20target%3D%22_blank%22%3E%40Sabbadino2%3C%2FA%3E%26nbsp%3Bwe%20havent%20validated%20if%20the%20b2c%20tokens%20work.%20In%20the%20current%20version%2C%20Universal%20Print%20is%20enabled%20for%20users%20who%20directly%20login%20and%20get%20their%20access%20token%20via%20Azure%20AD.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThanks%2C%3C%2FP%3E%0A%3CP%3ESaurabh%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor
Hi, I watched a video showing how to do print a job from server side using graph API.
How does server side print is related to user 365 licenses ? Can I call graph API to print using a client credential token ?
Can I print using a jwt token obtained from a b2c domain ?

Thank you
Enrico
5 Replies

@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:

Hope this helps.

 

Thx, Saurabh

Hi, thank you for your answer.

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

@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

Hi 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

@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