Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{"error":"Unauthorized"} all the time #6

Open
galuszkak opened this issue Apr 21, 2018 · 7 comments
Open

{"error":"Unauthorized"} all the time #6

galuszkak opened this issue Apr 21, 2018 · 7 comments

Comments

@galuszkak
Copy link

I've installed cockpit and CockpitQL (git clone to addons folder).

But I cannot access API. I've always get:
{"error":"Unauthorized"}

In logs there isn't any information, and I'm using Full access API-key. Should I do something additional?

@galuszkak
Copy link
Author

So, I made it partially working.

If I start cockpit this via php -S 0.0.0.0:80 index.php GraphQL request is working. But via php-fpm process is failing. Any ideas? Nothing in logs, is making me pretty unsure what is going on.

@panosru
Copy link

panosru commented Feb 1, 2019

bump on the same issue...

My nginx config looks like this:

# Nginx configuration

server {
    listen 80 default_server;
    listen [::]:80 default_server;
    root /var/www/html;
    index index.php index.html;
    #server_name localhost;

    charset utf-8;

   location / {
       # try_files $uri /index.php?$query_string;
       try_files $uri $uri/ /index.php;
   }

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    error_log  /var/log/nginx/error.log;
    access_log /var/log/nginx/access.log;

    sendfile off;

    client_max_body_size 100m;

    location ~ \.php$ {
        try_files $uri =404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass cockpit-app:9000;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_param COCKPIT_URL_REWRITE On;
        fastcgi_intercept_errors off;
        fastcgi_buffer_size 16k;
        fastcgi_buffers 4 16k;
    }

    # Deny direct access
    location ~ /(\.ht|\.git|cp|composer.json|package.json|storage\/logs\/cockpit.log|storage\/data\/) {
        deny all;
    }
}

@flayks
Copy link

flayks commented Feb 3, 2019

Same issue with Nuxt and Apollo

@tanc
Copy link

tanc commented Feb 19, 2019

Same for me. Frustrating as my origin master api-key worked, then I regenerated it and since then its giving me 401 every time. I've cleared cockpit cache at /settings/info and restarted nginx but no joy.

Edit: Apologies, was user error on my part, was hitting a test domain rather than production one.

@yakou32
Copy link

yakou32 commented Sep 12, 2019

Same here

I just downloaded the archive content to the /addons/CockpitQL directory.

api/graphql/query?token=token gives {"error":"Unauthorized"}

@flayks
Copy link

flayks commented Feb 4, 2020

Any progress on this issue?

@ronaldaug
Copy link

@flayks , I guess you may be facing the same error like me. Artur answered here that you can't use custom token. You can only use account token which is under account setting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants