Skip to content
This repository has been archived by the owner on Jan 24, 2019. It is now read-only.

Page defaults to Google sign in #108

Merged
merged 1 commit into from
Jun 8, 2015
Merged

Conversation

jehiah
Copy link
Member

@jehiah jehiah commented Jun 7, 2015

Hi,
Thanks for solving the previous request as i said i am very new to GO, my aim is to have Nginx authenticate via github

as of now i have nginx serving only the default home page, have enabled self signed certificate to test the authentication
my nginx config is as follows
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
listen 443 ssl;

    server_name ec2-52-25-160-240.us-west-2.compute.amazonaws.com;
    root /usr/share/nginx/html;
    index index.html index.htm;

    ssl_certificate /etc/nginx/ssl/nginx.crt;
    ssl_certificate_key /etc/nginx/ssl/nginx.key;
    add_header Strict-Transport-Security max-age=1209600;
    location / {
            proxy_pass http://127.0.0.1:4180;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Scheme $scheme;
            proxy_connect_timeout 1;
            proxy_send_timeout 30;
            proxy_read_timeout 30;
        }

and Oauth_proxy is running as follows: ./oauth2_proxy --upstream=https://127.0.0.1 --cookie-secret=secret --cookie-secure=true --client-id=2*********3 --client-secret=Aef**********a

my page always greets me with login with google account and also gives 404 after that

i want to start using the github credentials for logging please help, this is very critical

my call back url is
https://ec2-52-25-160-240.us-west-2.compute.amazonaws.com/oauth2/callback

@jehiah
Copy link
Member

jehiah commented May 31, 2015

If you want to authenticate with Github instead of Google you need to use --provider=github

@dbiswas1
Copy link
Author

Now i get the github page after i say authorise it gives 500 with following
essage

cannot unmarshal object into Go value of type []struct { Email string
"json:"email\

i know i am asking way too much things trust me i am unable to configure
this and this is very critical, please help me in this

On Sun, May 31, 2015 at 9:39 AM, Jehiah Czebotar notifications@github.com
wrote:

If you want to authenticate with Github instead of Google you need to use
--provider=github


Reply to this email directly or view it on GitHub
#108 (comment).

Regards
Deepak Biswas

@LukeHandle
Copy link

You might need to pass the domain / email list so it can authenticate against those.

@dbiswas1
Copy link
Author

--authenticated-emails used the above still the error persist
json: cannot unmarshal object into Go value of type []struct { Email string "json:"email""; Primary bool "json:"primary"" }

Please help me in getting this done

@dbiswas1
Copy link
Author

dbiswas1 commented Jun 1, 2015

Guys need your help in this

You might need to pass the domain / email list so it can authenticate
against those.


Reply to this email directly or view it on GitHub
#108 (comment).

@dbiswas1
Copy link
Author

dbiswas1 commented Jun 1, 2015

I tried giving the email name in the list with env --authenticated-emails, it still gives same error
json: cannot unmarshal object into Go value of type []struct { Email string "json:"email""; Primary bool "json:"primary"" }

currently we have a github organization and more or less all are using gmail.com email address, would appreciate any help on this

@dbiswas1
Copy link
Author

dbiswas1 commented Jun 1, 2015

Now when i introduced the github-org parameter the error changed

json: cannot unmarshal object into Go value of type []struct { Name string "json:"name""; Slug string "json:"slug""; Org struct { Login string "json:"login"" } "json:"organization"" }

i am using the following

./oauth2_proxy --provider=github --upstream=https://ec2-52-25-160-240.us-west-2.compute.amazonaws.com --cookie-secret=secret --github-org='_' --cookie-secure=true --client-id=_* --client-secret=****** &

unable to figure out any way to get this running desperately need help here

@dbiswas1
Copy link
Author

dbiswas1 commented Jun 2, 2015

Guys, Please help me in this would appreciate some inputs

@jehiah
Copy link
Member

jehiah commented Jun 6, 2015

@dbiswas1 You seem to be getting an unexpected response from the GitHub API. Can you post the full log line you got? you only pasted part of the log entry so it's hard to understand the context.

jehiah added a commit that referenced this pull request Jun 8, 2015
@jehiah jehiah merged commit 5a5d6df into bitly:master Jun 8, 2015
@jehiah
Copy link
Member

jehiah commented Jun 8, 2015

@dbiswas1 I've added some more specific logging around failed requests to the provider (github in your case). Please build a new version of oauth2_proxy and let me know what errors you get now.

@dbiswas1
Copy link
Author

dbiswas1 commented Jun 8, 2015

Thanks a lot, i will try this and inform you i am trying to implement this
a solution would be great if i can make it, will update about the progress

Thx
Deepak

On Mon, Jun 8, 2015 at 6:37 AM, Jehiah Czebotar notifications@github.com
wrote:

@dbiswas1 https://github.com/dbiswas1 I've added some more specific
logging around failed requests to the provider (github in your case).
Please build a new version of oauth2_proxy and let me know what errors
you get now.


Reply to this email directly or view it on GitHub
#108 (comment).

Regards
Deepak Biswas

@dbiswas1
Copy link
Author

Now i have a weird error, not sure how will i make this work
116.202.116.191 - - [15/Jul/2015:17:33:57 +0000] 52.27.38.143 GET - "/oauth2/start?rd=%2F" HTTP/1.0 "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Firefox/38.0" 302 255 0.000
2015/07/15 17:33:59 github.go:180: got 200 from "https://api.github.com/user/emails?access_token=" [{"email":"d**@gmail.com","primary":true,"verified":true}]
2015/07/15 17:33:59 oauthproxy.go:444: 127.0.0.1:39697 ("116.202.116.191") Permission Denied: "de**
*****19@gmail.com" is unauthorized
2015/07/15 17:33:59 oauthproxy.go:270: ErrorPage 403 Permission Denied Invalid Account

i checked form the browser with the credentials and i am authorized but it fails here

Thx
Deepak

@dbiswas1
Copy link
Author

Can you please reopen this, so that i can get some help i am trying from longtime to setup oAuth2

@jehiah jehiah deleted the unmarshal_error_108 branch September 23, 2015 13:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging this pull request may close these issues.

3 participants