Comments (4)
Is there a way to POST login information and get a token back via the API? It seems like an older version of Sentinel had that functionality, although I may have hand rolled it. In any case, it seems like a reasonable thing to provide out of the box.
from sentinel.
Looks like in v2 with the Ueberauth addition I must have removed that. I'll work on adding that back in. In the meantime you should be able to achieve that by posting to /auth/session
.
Sorry about that oversight.
from sentinel.
I look forward to a resolution to this regression.
Just in case anyone else runs into this problem, something like the following can be used to get a guardian token from the command line by posting to /auth/session
.
[email protected]
PASSWORD=my_password
HOST=http://localhost:8080
COOKIE_FILE=$(mktemp /tmp/api_auth_session_html.cookie.XXXXXX)
curl -s -c "${COOKIE_FILE}" -X POST -F "session[email]=${EMAIL}" -F "session[password]=${PASSWORD}" "${HOST}/auth/session" 2>/dev/null > /dev/null
curl -s -b "${COOKIE_FILE}" -X GET "${HOST}" | grep guardian_token | sed -e 's/^.*content="//g' | sed -e 's/".*$//g'
rm -f "${COOKIE_FILE}"
from sentinel.
Forgot about this one during my review process. I'll add it to the features/lockable_and_plug
branch changes, which include a number of other changes.
from sentinel.
Related Issues (20)
- Compilation error on file web/router.ex == HOT 3
- example sentinel app HOT 4
- Ueberauth JSON API HOT 3
- Ability to generate controllers and views during installation HOT 3
- Error while visiting sentinel paths HOT 7
- Error compiling - no function clause matching in Keyword.merge/2 HOT 1
- Error when using it inside an umbrella HOT 2
- Detail Mix Install Task Steps
- Disable confirmation
- Custom redirect paths HOT 7
- ** (Mix) The task "sentinel.gen.views" could not be found HOT 3
- with statement in Sentinel.Controllers.Html.AuthController.new_user has no else clause
- Guardian V1 Support HOT 3
- Question: Feature testing with Wallaby and ExMachina HOT 2
- Code Error when authenticating through third party provider (i.e. Github)
- Issues using with phoenix 1.3.0 HOT 4
- Uberauthenticator duplicate function with different bodies HOT 1
- Token Customization HOT 1
- Custom Model integration
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 sentinel.