c# - How to generate WOPI Access Token from WAC Office Server -


one of our customers want open word documents using office server. installed wac server on-premise open office documents in browser.

this document opened in iframe in our system. generate access token wac server using wopi api. did investigation, , found sharepoint doing that. can use httpclient in c# extract value. looks dirty! , i'm sure there better way generate access token? i'm totally new sharepoint , wac server. please help.

access token generated sharepoint

there wopi api documentation. i'm still confused how build request? check image taken documentation.

enter image description here

thank in advance :)

you don't need implement /wopibootstrapper endpoint nor getnewaccesstoken method. they're specific office online (365) integration program.

your job generate access_token included in post request of wopi frame in application (similarly picture in question).

this token used wopi client (wac/owa/oos server). wopi client doesn't need able decipher token or understand in other way. takes , appends every request being made against wopi host. wopi host, on other hand, needs able validate token. token resources given user has access to. make sure understand concept of access_token well. especially:

access tokens must scoped single user , resource combination.

how generate token entirely you. typically, you'd ask user/role store (this can windows acl store, database or else) whether given user has access resource , store information (claims) within token , encrypt (so can't faked). option include information user , let wopi host figure out permission during token validation (talk user/role store)...this possible because, mentioned earlier, wopi client doesn't care what's in token. can set access_token=xyz , never check in wopi host if don't care authorization @ all.

the process of generating , validating tokens demonstrated in officedev/pnp-wopi. see homecontroller , wopisecurity classes.

you can see other examples in other answer here.


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -