Git Product home page Git Product logo

auth-service's Introduction

OAuth2

Read OAuth 2.0 Tutorial

Start

In this example, the postgres connection info is read from the DATABASE_URL environment variable which you can set when you run, for example:

$ DATABASE_URL=postgres://postgres:1234@localhost/postgres node index.js

or use npm command in combination with start script defined in package.json

$ npm start

Access Token Request Samples

2 step with password grant type

POST /oauth/token HTTP/1.1 Host: localhost:3000 Cache-Control: no-cache Content-Type: application/x-www-form-urlencoded

grant_type=password&client_id=abc1&client_secret=EkfBWYQ34tgQ&username=paulv&password=test

Response

{"token_type":"bearer","access_token":"981a88f0a3ad54cb6ac5dc9e525174cf8c6f0e55","expires_in":3600}

3 step with authorization_code grant type

First authentication code must be received. Then:

POST /oauth/token HTTP/1.1 Host: localhost:3000 Cache-Control: no-cache Content-Type: application/x-www-form-urlencoded

grant_type=authorization_code&client_id=abc1&client_secret=EkfBWYQ34tgQ&code=762b8f16be488c859df44b3b6337bbe0421d04e4

Response

{"token_type":"bearer","access_token":"7c96128efd3e262921101e1120b7f8481a881721","expires_in":3600}

auth-service's People

Watchers

 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.