anvilresearch / connect

A modern authorization server built to authenticate your users and protect your APIs
http://anvil.io
MIT License
361 stars 86 forks source link

Cannot GET / - what to do after installation #93

Closed kwo closed 9 years ago

kwo commented 9 years ago

After following the getting started instructions at http://anvil.io/#getstarted, I'm not sure what to do next. Attempting to browse to the server URL at http://localhost:3000/ returns a plain text error message in the browser: "Cannot GET /". Do I need to customize the webapp first? How would I do that? Thx.

oren commented 9 years ago

I am in the process of getting everything up and running as well. I didn't finish yet but I can try helping you out. As far as i understand you need to also generate public and private RSA keys and locate them inside config/keys folder (you'll have to create that folder first).

Also, you'll need to tell your connect server about any client you want to use. the command to do that is nv add. here is what I did:

nv add client '{ "client_name": "app1", "client_uri": "http://app1.myserver.com:9000", "redirect_uris": ["http://app1.myserver.com:9000/callback"], "post_logout_redirect_uris": ["http://myserver.com:9000"], "trusted": "true" }'

I also had to add this line to /etc/hosts:

127.0.0.1 app1.myserver.com

Save the output from that command. you'll need to enter the _id in the app that will use that server.

After running the connect server you'll want to also run at least one app that is using this server. There is an angular example app here: https://github.com/anvilresearch/connect-example-angularjs There is nothing in it's readme (yet). you'll need to npm install -g grunt-cli bower, npm install and bower install and tweak app/rb.html and app/script/app.js a bit so that app will know how to access things from the connect app (client_id and redirect_uri). Running the client app is done with grunt serve.

I'll submit pull requests to both projects as soon as i'll figure it out!

oren commented 9 years ago

also, feel free to join the chat: https://gitter.im/anvilresearch/connect

christiansmith commented 9 years ago

@kwo sorry for the incomplete instructions. We're in the process of completely rewriting the docs in this repo. The wiki has some mostly correct information, but it's missing some newer features.

The root path / doesn't actually respond with anything. I guess we should have it send a status message of some kind.

To see that the server is working, you can use the command $ nv uri to get an authorization url. That should take you to the signin page. The server isn't all that useful unless you have an app or two that integrate with it.

What language/framework/platform are you working with? Several libs are known to work with Anvil and many more should be usable with a little tweaking here and there.

I'll be on gitter for the most of the day today. Feel free to drop in and say hello.

oren commented 9 years ago

nv uri

Error: Cannot find module '/usr/lib/node_modules/anvil-connect/config/development.json
christiansmith commented 9 years ago

Are you running that from the root of your project?

oren commented 9 years ago

nope.

cd ~/projects/connect-server 
nv uri

events.js:72 throw er; // Unhandled 'error' event ^ Error: spawn ENOENT at errnoException (child_process.js:1011:11) at Process.ChildProcess._handle.onexit (child_process.js:802:34)

adi-ads commented 9 years ago

nv version?

oren commented 9 years ago

nv -v => Anvil Connect v0.1.38

kwo commented 9 years ago

@christiansmith I'm developing in Node and Go and I see that there is another repository here with a node client (and I guess I can also use passport).

I just tried "nv uri" and that took me to a login page that I was expecting.