GithubHelp home page GithubHelp logo

Comments (15)

juju95 avatar juju95 commented on July 29, 2024

the oauth module installed is 1.2.3

from nextcloud-grauphel.

cweiske avatar cweiske commented on July 29, 2024

Start a shell (command line) on your android device and then run "logcat". Tomdroid's logging messages should show up there. What do you get?

But I think the problem lies on the server. The error on the api/1.0 page is probably the cause.
What web server software do you use, which version? Which PHP version? How is PHP connected to the web server software? (mod_php, fastcgi, fpm?)

from nextcloud-grauphel.

juju95 avatar juju95 commented on July 29, 2024

I think too ( can't check for logcat ) my phone is not rooted and seems it need to be to acces others apps logs.

For my owncloud install, it's on a Debian 7.6 server with Apache + PHP 5.4.4 fastCGI

Others owncloud apps using / offering remote access are working well, what can be different in needs for grauphel ?

( Nothing in owncloud logs about the app )

from nextcloud-grauphel.

cweiske avatar cweiske commented on July 29, 2024

Looking at the source code of the oauth extension, this can only happen if the HTTP_AUTHORIZATION header is filled with a non-oauth value.

Do the following to check that:

  1. Open grauphel/controller/apicontroller.php
  2. Go to public function index($route = 'grauphel.api.index')
  3. Before $deps =, write the following: var_dump($_SERVER, $_ENV);die();
  4. Open the api/1.0 page in your browser
  5. Paste the output here

from nextcloud-grauphel.

juju95 avatar juju95 commented on July 29, 2024

Thanks for your search, here is the result :

array(42) {
  ["PHPRC"]=>
  string(32) "/home/cloud/fcgi-bin/../etc/php5"
  ["SCRIPT_FILENAME"]=>
  string(33) "/home/cloud/public_html/index.php"
  ["PATH"]=>
  string(28) "/usr/local/bin:/usr/bin:/bin"
  ["PWD"]=>
  string(20) "/home/cloud/fcgi-bin"
  ["SHLVL"]=>
  string(1) "0"
  ["PHP_FCGI_MAX_REQUESTS"]=>
  string(5) "99999"
  ["CONTENT_LENGTH"]=>
  string(1) "0"
  ["PATH_TRANSLATED"]=>
  string(45) "/home/cloud/public_html/apps/grauphel/api/1.0"
  ["PATH_INFO"]=>
  string(22) "/apps/grauphel/api/1.0"
  ["SCRIPT_NAME"]=>
  string(10) "/index.php"
  ["REQUEST_URI"]=>
  string(32) "/index.php/apps/grauphel/api/1.0"
  ["QUERY_STRING"]=>
  string(0) ""
  ["REQUEST_METHOD"]=>
  string(3) "GET"
  ["SERVER_PROTOCOL"]=>
  string(8) "HTTP/1.1"
  ["GATEWAY_INTERFACE"]=>
  string(7) "CGI/1.1"
  ["REMOTE_PORT"]=>
  string(5) "14309"
  ["SERVER_ADMIN"]=>
  string(18) "[no address given]"
  ["DOCUMENT_ROOT"]=>
  string(23) "/home/cloud/public_html"
  ["REMOTE_ADDR"]=>
  string(37) "[REMOVED_IP]"
  ["SERVER_PORT"]=>
  string(3) "443"
  ["SERVER_ADDR"]=>
  string(20) "[REMOVED_IP]"
  ["SERVER_NAME"]=>
  string(12) "[REMOVED_DOMAIN]"
  ["SERVER_SOFTWARE"]=>
  string(6) "Apache"
  ["SERVER_SIGNATURE"]=>
  string(0) ""
  ["HTTP_COOKIE"]=>
  string(272) "oc2a507f8626=jlmf4c7p089dk56jpq12d3up84; rlsession=5ea573c2f124d85efcd2da0d5b3c598f; rlaauth=4W7__ZSxTqBcc3lsMWqCwkJYIvDVPXZLuEb29Z5sJ92VEuGBh2qvyCj7raUzmblHbPhF4B53rHO8lMPC-QjHPNMZT9Un3bWV; rltoken=f2b5d464377f201b3c3871efd5d36b1a; oc1c0d382491=m3jbf1jvbjnpoptv0a8clh7ks3"
  ["HTTP_ACCEPT_LANGUAGE"]=>
  string(35) "fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4"
  ["HTTP_ACCEPT_ENCODING"]=>
  string(12) "gzip,deflate"
  ["HTTP_REFERER"]=>
  string(45) "https://[REMOVED_DOMAIN]/index.php/apps/grauphel/"
  ["HTTP_USER_AGENT"]=>
  string(109) "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.103 Safari/537.36"
  ["HTTP_ACCEPT"]=>
  string(74) "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"
  ["HTTP_CONNECTION"]=>
  string(5) "close"
  ["HTTP_HOST"]=>
  string(12) "[REMOVED_DOMAIN]"
  ["SSL_TLS_SNI"]=>
  string(12) "[REMOVED_DOMAIN]"
  ["HTTPS"]=>
  string(2) "on"
  ["htaccessWorking"]=>
  string(4) "true"
  ["HTTP_AUTHORIZATION"]=>
  string(0) ""
  ["SCRIPT_URI"]=>
  string(52) "https://[REMOVED_DOMAIN]/index.php/apps/grauphel/api/1.0"
  ["SCRIPT_URL"]=>
  string(32) "/index.php/apps/grauphel/api/1.0"
  ["FCGI_ROLE"]=>
  string(9) "RESPONDER"
  ["PHP_SELF"]=>
  string(32) "/index.php/apps/grauphel/api/1.0"
  ["REQUEST_TIME_FLOAT"]=>
  float(1412582365.4538)
  ["REQUEST_TIME"]=>
  int(1412582365)
}
array(0) {
}

from nextcloud-grauphel.

cweiske avatar cweiske commented on July 29, 2024

Nothing to see there. Hm.

Remove the debug statement, and in the same function is

} catch (\OAuthException $e) {

Replace it with

} catch (\OAuthException $e) {var_dump($e->additionalInfo);die();

What do you get?

from nextcloud-grauphel.

juju95 avatar juju95 commented on July 29, 2024

NULL

from nextcloud-grauphel.

cweiske avatar cweiske commented on July 29, 2024

I don't know what's happening. The only way I can reproduce the problem is by passing a username and a password via HTTP basic auth:

$ curl -u u:p http://wolke.bogo/index.php/apps/grauphel/api/1.0
oauth_problem=signature_method_rejected

I don't get that message in any other way.

Do you have some special HTTP auth configuration? Do you use HTTP basic auth to authenticate at owncloud? What happens if you simply call the api/1.0 page via curl with no further parameters?

from nextcloud-grauphel.

cweiske avatar cweiske commented on July 29, 2024

@juju95 - try to use the git version. The workaround I implemented might help.

from nextcloud-grauphel.

juju95 avatar juju95 commented on July 29, 2024

Great, now this part works with your change in oauth lib.
Get this result if i access the api on the web :
{
"oauth_request_token_url": "https://[MYDOMAIN]/index.php/apps/grauphel/oauth/request_token",
"oauth_authorize_url": "https://[MYDOMAIN]/index.php/apps/grauphel/oauth/authorize",
"oauth_access_token_url": "https://[MYDOMAIN]/index.php/apps/grauphel/oauth/access_token",
"api-version": "1.0",
"user-ref": {
"api-ref": "https://[MYDOMAIN]/index.php/apps/grauphel/api/1.0/[MYLOGIN]",
"href": null
}
}

But can't connect with tomdroid, when i'm redirected from the app to my cloud login page, after i click on "Yes i accept this app", a get a OnCloud error "[4096] No oauth header"

from nextcloud-grauphel.

juju95 avatar juju95 commented on July 29, 2024

and in owncloud admin log :

Fatal index OAuthException: No oauth auth header [4096] 2014-10-07T00:18:52+00:00
Fatal index OAuthException: No oauth auth header [4096] 2014-10-07T00:18:35+00:00

from nextcloud-grauphel.

cweiske avatar cweiske commented on July 29, 2024

Try again with latest git.

Please also answer: Do you have some special HTTP auth configuration? Do you use HTTP basic auth to authenticate at owncloud? What happens if you simply call the api/1.0 page via curl with no further parameters?

from nextcloud-grauphel.

juju95 avatar juju95 commented on July 29, 2024

no, i don't use any special http auth configuration, standard web account, just put a SSL cert on it.

Tried your new git but it just give again our old "oauth_problem=signature_method_rejected"

And if i do the same curl, but with your previous git i get

{
"oauth_request_token_url": "https://[MYDOMAIN]/index.php/apps/grauphel/oauth/request_token",
"oauth_authorize_url": "https://[MYDOMAIN]/index.php/apps/grauphel/oauth/authorize",
"oauth_access_token_url": "https://[MYDOMAIN]/index.php/apps/grauphel/oauth/access_token",
"api-version": "1.0"
}

So seems to be good, but when i enter https://[MYDOMAIN]/index.php/apps/grauphel/ in tomdroid, i get a not found error

from nextcloud-grauphel.

cweiske avatar cweiske commented on July 29, 2024

I don't know how to proceed. If I had access to the server I could try to find out what's actually wrong, but remotely I've no idea what the reason for the problems could be.

from nextcloud-grauphel.

cweiske avatar cweiske commented on July 29, 2024

@juju95 - thanks to the server access I could finally find the error. The oauth extension has a bug that only surfaces with your server setup :) See https://bugs.php.net/bug.php?id=68168 for more details.

I circumvent the error in grauphel now.

from nextcloud-grauphel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.