Comments (5)
Hi @kikuchiyo,
You're right. I don't think I documented authentication well enough for this project. I would update /db/seeds.rb
(I just realized much of that configuration is specific to this particular application...) and
At the very least, update the admin account to your own, and the user1
and user2
seeds can stay or go. Then run rake db:reset db:seed
Once you have your accounts in order you can access your login token by sending a POST request to http://localhost:#{som_port}/v1/auth/login/ for example:
curl -X POST -F 'session[email][email protected]' -F 'session[password]=test_password' http://0.0.0.0:3000/v1/auth/login
This will return a response with an authorization token that should be used for all subsequent requests, and allow you to access the other endpoints.
from bridgely-api.
Thanks @nason
from bridgely-api.
@nason, it's giving me back the same authorization_token I had been testing with earlier ( obtained via rails console ). Should I be able to do this ( assuming the correct authorization_token ) or should I pass a differently named parameter?
curl -G -d 'authorization_token=#{my_token_here}' http://localhost:3000/v1/companies/1/employees.json
from bridgely-api.
The authorization token is expected in the request header, so your example won't work but something like this should:
curl -G -H 'Authorization:Token {your_token_here}' http://localhost:3000/v1/companies/1/employees.json
from bridgely-api.
perfect! thanks again @nason
from bridgely-api.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bridgely-api.