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: "No access token provided." #5

Open
ichasco opened this issue Apr 5, 2020 · 0 comments
Open

Error: "No access token provided." #5

ichasco opened this issue Apr 5, 2020 · 0 comments

Comments

@ichasco
Copy link

ichasco commented Apr 5, 2020

Hi,
I have configured through gitlab oauth. But it says "no access token provided"

Compiled modules:

NGINX_VERSION 1.17.9
LUA_NGX_MODULE 0.10.13
NGX_DEVEL_KIT 0.3.1
LUAJIT_VERSION 2.0.5

Luarock installed modules:

lua-cjson
lua-resty-http
luaossl
ngx-oauth

The conf is:

nginx.conf

    lua_ssl_trusted_certificate /etc/ssl/certs/ca-certificates.crt;
    lua_ssl_verify_depth 3;
    lua_package_path '/usr/local/share/lua/5.1/ngx-oauth/?.lua;;';

default.conf

    set $oauth_client_id                'XXXXXX';
    set $oauth_client_secret            'XXXXXX';
    set $oauth_redirect_uri             '/_oauth/callback';
    set $oauth_authorization_url        'https://git.example.com/oauth/authorize';
    set $oauth_token_url                'https://git.example.com/oauth/token';
    set $oauth_userinfo_url             'https://git.example.com/oauth/userinfo';

    location /_oauth/login {
        content_by_lua_file '/usr/local/share/lua/5.1/ngx-oauth-login.lua';
    }

    location /_oauth/callback {
        content_by_lua_file '/usr/local/share/lua/5.1/ngx-oauth-redirect-handler.lua';
    }

    location /_oauth/logout {
        content_by_lua_file '/usr/local/share/lua/5.1/ngx-oauth-logout.lua';
    }

    location / {
        access_by_lua_file '/usr/local/share/lua/5.1/ngx-oauth-proxy.lua';
        rewrite ^/_proxy/(.*)$ /$1 break;
        proxy_pass http://example;
    }

Log errors:

nginx | 2020/04/05 17:53:26 [warn] 7#0: *67 [lua] nginx.lua:33: log_formatted(): [ngx-oauth] No access token provided., client: 188.127.X.X, server: _, request: "GET / HTTP/1.1", host: "example.com"

Thanks

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

1 participant