Coder Social home page Coder Social logo

Comments (4)

sgeos avatar sgeos commented on July 29, 2024

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.

britton-jb avatar britton-jb commented on July 29, 2024

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.

sgeos avatar sgeos commented on July 29, 2024

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.

britton-jb avatar britton-jb commented on July 29, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.