Code Monkey home page Code Monkey logo

Comments (6)

sundarkrish avatar sundarkrish commented on August 23, 2024

getAccessToken() is called by the library to generate the JSON payload to be returned during localhost:3000/ ?
We just have to write a logic to return the accessToken object from this method.And the library will do the internal calling ?

from node-oauth2-server-example.

pedroetb avatar pedroetb commented on August 23, 2024

Hi,

saveAccessToken() is a method you must implement, and you know it will receive that parameters. This is determined by node-oauth2-server, my project is an example of usage.

getAccessToken() receives an access token from the user, and checks its validity (must has been generated previously). Also is called by the library, with a determined parameters.

Check node-oauth2-server docs for further explanations.

Thanks.

from node-oauth2-server-example.

sundarkrish avatar sundarkrish commented on August 23, 2024

okay Thanks,I want some example on how to get refresh token along with access token.And also an example to use a refresh token got previously to get a new access token.
The grant type in the model is to define what all types the protocol supports.So,we can supply any one among those mentioned in the model,in our POST request payload .Am I correct ?

from node-oauth2-server-example.

pedroetb avatar pedroetb commented on August 23, 2024

There is no example of refresh token grant type yet, but you can use it.

Add the desired grant types in server properties and then you can use them in your POST requests.

from node-oauth2-server-example.

sundarkrish avatar sundarkrish commented on August 23, 2024

Can we use multiple grant types.If yes,should it be separated by commas or by &.

from node-oauth2-server-example.

pedroetb avatar pedroetb commented on August 23, 2024

No, you can send only one grant type by request. But you could request multiple access tokens with multiple requests, I suppose.

from node-oauth2-server-example.

Related Issues (8)

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.