Closed rchcomm closed 9 years ago
No, access_token is the second parameter of [owas.domain]/we/wordeditorframe.aspx, not the parameter of wopihost. it will received by owas first, and owas pass this parameter to the wopihost for authentication when call the wopisrc url.
how to create access_token
and i need an asp page to edit documents without any console application. Help needed to create it
access_token, generally, is the credential, for accessing the file, such as encode(base64) from username and password
Thanks for reply
I need a sample script for editing in asp
and I don't saw any thing where I can pass username and password
for example: access_token=base64(u=userid;p=password)
I am trying from months for this but I can't build or get any asps sample for editing
For me I can edit documents using sharepoint but I need to edit without sharepoint in my web application
Can I get any asp sample please
you can use this project "marx-yu/WopiHost". what your problem? for asp sample, I am sorry, I have not any help.
Thanks for reply
on what file in your project i have to edit the code for passing my user credentials.
do i need to pass user credentials like domain\user or just user or do i change the values in cobaltserver.cs in FileSession(filename, m_docsPath + "/" + filename, @"yonggui.yu", @"yuyg", @"yonggui.yu@emacle.com", false) and CobaltSession can you please tell me what is the best way for building asp for this ???
Now I can view document in the browser.I need to edit without sharepoint in my web application by PHP.I cannot learn C# before.Does the access_token is necessary to create it?
I just want to install Office web apps server 2013 without any integration like sharepoint, exchange or lync.And i need to edit the office files in browser.
Access token is something that you provide to WOPI Client (OWA) and WOPI Client uses it to authenticate against WOPI Host. marx-yu/WopiHost is example of such WOPI Host. If you have a look at CobaltServer.cs (lines 64,66) you'll see that it only checks whether the access_token is set in the query string. In real scenario you would probably want to extract user credentials from it, perform authentication and based on requested file perform also authorization check. To use marx-yu/WopiHost in web application just replace IAsyncResult result with HttpContext context and adjust the code accordingly. Then create IHttpHandler and pass the context to CobaltServer. I'm currently working on a generic WOPI host that will be compatible with web apps as well as windows apps. It'll be on GitHub in few weeks.
@petrsvihlik thanks for so detail explain and bright work of WOPI host
@marx-yu, @petrsvihlik i really cant understand what to edit i dont have much programming skills
can you please tell me what modifications has to be done
my process until now i can edit all documents using sharepoint
@marx-yu , @petrsvihlik
i edited code in cobaltserver.cs i edited cobaltserver.cs var fileExt = filename.Substring(filename.LastIndexOf('.') + 1); if (fileExt.ToLower().Equals(@"xlsx")) editSession = new FileSession(filename, m_docsPath + "/" + filename, @"administrator", @"admin", @"administrator@mydomain.tk", false); else editSession = new CobaltSession(filename, m_docsPath + "/" + filename, @"administrator", @"admin", @"administrator@mydomain.tk", false); CobaltSessionManager.Instance.AddSession(editSession);
and uploaded the files in https://defuse.ca/checksums.htm to create sha256
but i am getting error on both
what error are you getting? have you tried to debug the CobaltServer? does the request even reach the code? i see you are passing some kind of token - that should be enough for WopiHost as it only checks whether it's set or not. so the problem will be elsewhere
@petrsvihlik can i message you in twitter ???
hi, i'd prefer github or stackoverflow as those are the right places to discuss dev topics.
@petrsvihlik ok but i want to show everything by giving remote desktop of mine
@kmkmahesh maybe later in the evening (i'm gmt+1). i also have work to be done :D
ok when ever you are free i am ready i just emailed to your organization email
Usage & Examples
http://[owas.domain]/we/wordeditorframe.aspx?WOPISrc=http%3a%2f%2flocalhost%3a8080%2fwopi%2ffiles%2fword.docx&access_token=[token]&ui=zh-CN
http://[owas.domain]/p/PowerPointFrame.aspx?WOPISrc=http%3a%2f%2flocalhost%3a8080%2fwopi%2ffiles%2fppt.pptx&access_token=[token]&ui=zh-CN
http://[owas.domain]/x/_layouts/xlviewerinternal.aspx?WOPISrc=http%3a%2f%2flocalhost%3a8080%2fwopi%2ffiles%2fBook1.xlsx&access_token=[token]&ui=zh-CN
==>
http://[owas.domain]/x/_layouts/xlviewerinternal.aspx?WOPISrc=http%3a%2f%2flocalhost%3a8080%2fwopi%2ffiles%2fBook1.xlsx?access_token=[token]&ui=zh-CN
&access_token =====> ?access_token
-- Example site url -- https://github.com/rchcomm/WopiHost/blob/master/README.md