0

I am tring to invoke WebScript in Alfresco remotely using the URL http://192.168.1.2:8080/alfresco/service/sample/folder/Company%20Home and the url will promth me with the authentication window allowing me to entire the username and password. This invocation works completely fine in the Browser..

Followed the steps described in the alfresco : http://wiki.alfresco.com/wiki/Web_Scripts

But when im tring to do the same in android app using webview im facing Authentication Error (HTTP Status 401-Error) and its not promthing me with the authentication window.

Raman
  • 262
  • 1
  • 9
Surya
  • 439
  • 3
  • 9
  • 31
  • Can you show the relevant code parts of your WebView? Did you configure a WebViewClient (http://developer.android.com/reference/android/webkit/WebViewClient.html)? – Jörn Horstmann Feb 21 '12 at 13:38

1 Answers1

2

If you want to integrate it with an application you can better use the Login Webscript.

So in your app, just make a configure view, which stores the user + pass (encrypted). And then before you do the request login and then with the ticket Authentication call your webscript.

It will then look like this: http://192.168.1.2:8080/alfresco/service/sample/folder/Company%20Home?alf_ticket=<TICKET>

Sometimes that doesn't work, then use http://192.168.1.2:8080/alfresco/service/sample/folder/Company%20Home?ticket=<TICKET> instead.

Good luck!

Tahir Malik
  • 6,623
  • 15
  • 22
  • Thanksssssss a lot...I am able to list the Folders : Folder: /Company Home > Data Dictionary > Guest Home > User Homes > Sites > Alfresco Workflow Environment New Text Document.txt.... The problem what I am facing is when i click on to one of these folders, example:Sites...,It again throws with 401 error(Authentication Error)... As I know even this need to be authenticated, how can i set authentication or pass alf_ticke in the URL for each of these folders or is there any other way to overcome this problem...Please let me know.. Thanks in advance!!! – Surya Feb 22 '12 at 04:43
  • ?? you'll need to pass the TICKET to every request you do to Alfresco. So I don't really know why you're using the webview, just use the JSON string then you can build your own UI. If you really want to use the webview look at this: http://stackoverflow.com/questions/4220832/webview-basic-authentication-help – Tahir Malik Feb 22 '12 at 08:26
  • Ok thanks :)Can i get any good documents to refer to build my own UI using JSON string.... – Surya Feb 22 '12 at 08:35
  • Hi, I don't really know. Here you have the RESTful API: http://wiki.alfresco.com/wiki/Repository_RESTful_API_Reference And http://wiki.alfresco.com/wiki/3.0_REST_API probably – Tahir Malik Feb 22 '12 at 12:22