sameersbn / docker-gitlab-ci

Dockerfile to build a GitLab CI container image.
http://www.damagehead.com/docker-gitlab-ci/
MIT License
199 stars 51 forks source link

The redirect uri included is not valid #31

Closed zhangspook closed 9 years ago

zhangspook commented 9 years ago

gitlab and gitlab-ci in same server,IP: 192.168.0.20

I install them as yous

when i login gitlab-ci with giltlab,it occur cant't find the site. so i change your command 'GITLAB_URL'to http://192.168.1.20:10080' like this,

gitlab: docker run --name='gitlab' -d --link=postgresql-gitlab:postgresql --link=redis-gitlab:redisio --publish=10022:22 --publish=10080:80 --env='GITLAB_PORT=10080' --env='GITLAB_SSH_PORT=10022' --env='GITLAB_HOST=192.168.0.20' --volume=/srv/docker/gitlab/gitlab:/home/git/data sameersbn/gitlab:7.10.4

gitlab-ci: docker run --name=gitlab-ci -d --link=postgresql-gitlab-ci:postgresql --link=redis-gitlab-ci:redisio --publish=10081:80 --env='GITLAB_CI_PORT=10081' --env='GITLAB_URL=http://192.168.0.20:10080' --env='GITLAB_APP_ID=0a7ffc4a5b3af54c74bb1de038ac6a9518ba8777d6d86f8327b514c3ae5140e6' --env='GITLAB_APP_SECRET=b421c3afa917a7062d49668a016aee212ad081a770d4f9775903e6fe2460815d' --volume=/srv/docker/gitlab-ci/gitlab-ci:/home/gitlab_ci/data sameersbn/gitlab-ci:7.10.4

login gitlab-ci "http://192.168.0.20:10081"-->"http://192.168.0.20:10080" then it occur other problem: I get the following error in gitlab: The redirect uri included is not valid.

sameersbn commented 9 years ago

@zhangspook I tested your commands and everything looks they way it should. The reason why you are seeing the issue is because you have either configured the oauth callback url to http://localhost:10081/user_sessions/callback and accessing gitlab-ci using http://192.168.0.20:10081. This does not seem to work. Change the callback url to http://192.168.0.20:10081/user_sessions/callback ` and it should work

edit: this is one of the reasons why using DNS entries is a better idea as opposed to using ip addresses.

zhangspook commented 9 years ago

http://192.168.0.20:10081/user_sessions/callback is right

Page Display `Authorize gitlab-ci to use your account?

This application will be able to:

Access your API

Authorize Deny`

Click Authorize to report the error. "Sorry but, something went wrong We're" 500

log: “Started POST "/oauth/authorize" for 127.0.0.1 at 2015-05-25 07:03:09 +0000 Processing by Oauth::AuthorizationsController#create as HTML Parameters: {"utf8"=>"✓", "authenticity_token"=>"[FILTERED]", "client_id"=>"53207eaed63524b2c841f49f3ad5413093ddd68a3fcf084a473f31c8cfa96461", "redirect_uri"=>"http://192.168.0.20:10081/user_sessions/callback", "state"=>"", "response_type"=>"code", "scope"=>"api"} Redirected to http://192.168.0.20:10081/user_sessions/callback?code=bf3af960d13056d14d3119167f0c9af6b9afc5ceef199ca37bc04f84aed05589 Completed 302 Found in 26ms (ActiveRecord: 17.0ms9”

zhangspook commented 9 years ago

sorry ,I did not shut down the firewall thanks!

bullub commented 3 years ago

sorry ,I did not shut down the firewall thanks!

Whether we can try to use regular expressions or support the configuration of origin to authenticate authorization, because in some scenarios, many pages in the website can trigger authorization and be called back. It is not realistic to list the redirect URIs one by one, but this demand is very urgent.