Giter Club home page Giter Club logo

auth0-curl's Introduction

auth0-curl

A simple curl wrapper that calls Auth0 (more specifically /oauth/ro), retrieves a JWT and sticks the correct Authorization header for you. Any argument is passed to curl, see the source.

Setup

  • Edit the script and replace the 4 environment variables (AUTH0_DOMAIN, AUTH0_CLIENTID, AUTH0_USERNAME, AUTH0_PASSWORD) with your Auth0 setup
  • Install jq, a very nice JSON parser

Usage

Exactly like you would use curl, no restrictions.

curl-auth0 -vvv -X GET 'http://localhost:8080/my-api'

How it works

Behind the scenes, this will do:

  1. a call to Auth0 /oauth/ro
  2. get the result (a JWT) that looks like this: {"id_token":"xxx.yyy.zzz","access_token":"aaaaaaaaaaaaaaaa","token_type":"bearer"}
  3. extract the id_token from the JWT
  4. call curl with the args you supplied to curl-auth0, and add the Authorization: Bearer ${id_token} header

auth0-curl's People

Contributors

pmq avatar

Stargazers

William Tran avatar  avatar Darren Day avatar Juan Manuel Mesa avatar Deepak Kannan avatar  avatar Dave Riddle avatar Cristian Douce avatar Rodrigo López Dato avatar  avatar Nicolas André avatar

Watchers

Lisa Smith avatar Nicolas André avatar  avatar James Cloos avatar

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.