0

[SOLVED]

i need your help. Currently i am working with Moodle 2.7. I want to connect my moodle with google Authentication, so i downloaded OAuth2 in the moodle website (Plugins).

I have my own server, which is has static ip to access it. Example: https:10.0.181.201/moodle
said that its a location of my moodle.

I just follow everything starts from take google Client ID and secret code also consent screen. when finished, i used Google login button privided inside OAuth2, it shows

Error 400. invalid_request. device_id and device_name are required for private IP:

https://10.0.181.201/moodle/auth/googleoauth2/gogle_redirect.php    

and when i modify config.php in moodle folder from

$CFG->wwwroot = 'https://10.0.181.201/moodle';    

to

$CFG->wwwroot = 'https://localhost/moodle';    

it works perfect (i am log in as a root in my server) but can't others host cant access it because will direct to their own localhost.

anyone can solved this problem? Thanks

ironcode
  • 1
  • 3
  • Looks like Google Auth doesn't accept private IP addresses - there is a work around though - http://stackoverflow.com/questions/24736168/error-invalid-request-device-id-and-device-name-are-required-for-private-ip – Russell England Nov 11 '14 at 09:15
  • I did already all the steps in the link you gave to me but still doesn't work. i've changed the hosts.conf (make an fake domain). but still the same problem. – ironcode Nov 12 '14 at 14:06

1 Answers1

0

I found already how to solve this problem. first of all, i am using OAuth2 integrated with moodle. you can get it official plugins at moodle website.

After checking all my setting in my server (using centOS based on Linux). starting from smb.conf, hosts.conf, its all okay.

and now, the problem is in my hosts (i am using windows), so i need to change my hosts file in windows. you can go to

%systemroot%\system32\etc\drivers\hosts

you can add your static ip of your server to your host's host ex:

10.0.181.201 test.com

so, when you type your server name, it will directly to the ip address that you assign in the hosts file.

Thanks

ironcode
  • 1
  • 3
  • these are links that help me setting config in linux server: [link1](http://stackoverflow.com/questions/24736168/error-invalid-request-device-id-and-device-name-are-required-for-private-ip) [link2](http://stackoverflow.com/questions/11485271/google-oauth-2-authorization-error-redirect-uri-mismatch) [link3](http://www.experts-exchange.com/Networking/Linux_Networking/Q_28409046.html) [link4](https://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/integrate-ms-networks.html#id2586120) [link5](https://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/NetworkBrowsing.html) – ironcode Nov 15 '14 at 10:30
  • these are links that help me setting config in linux server: [link6](http://forums.opensuse.org/showthread.php/454546-nmblookup-resolves-but-cannot-ping-netbios-names-or-ping-FQDN) [link7](http://www.oreilly.com/openbook/samba/book/ch07_03.html) [link8](https://github.com/DigitalOcean-User-Projects/Articles-and-Tutorials/blob/master/set_hostname_fqdn_on_ubuntu_centos.md) – ironcode Nov 15 '14 at 10:35