GithubHelp home page GithubHelp logo

o2r-project / o2r-bouncer Goto Github PK

View Code? Open in Web Editor NEW
1.0 6.0 2.0 812 KB

Node.js implementation for the oauth2-authentification process of the o2r web api

License: Apache License 2.0

JavaScript 96.55% Shell 0.86% Dockerfile 2.58%
microservice oauth orcid

o2r-bouncer's People

Contributors

jankoppe avatar lukaslohoff avatar nuest avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

nuest lukaslohoff

o2r-bouncer's Issues

Bouncer does not start if tokens are missing

bouncer_1 | Thu, 10 Aug 2017 10:06:48 GMT bouncer Trying to connect to MongoDB in 3000ms
bouncer_1 | Thu, 10 Aug 2017 10:06:48 GMT bouncer Started application.
bouncer_1 | Thu, 10 Aug 2017 10:06:48 GMT bouncer Started application.
bouncer_1 | Thu, 10 Aug 2017 10:06:48 GMT bouncer Mongoose: Disconnected all connections.
bouncer_1 | Thu, 10 Aug 2017 10:06:51 GMT bouncer Connect to MongoDB (#4) ...
bouncer_1 | Thu, 10 Aug 2017 10:06:51 GMT bouncer Initial connection open to mongodb://mongodb/muncher: 1
bouncer_1 | Thu, 10 Aug 2017 10:06:51 GMT bouncer Initialize application
bouncer_1 | Thu, 10 Aug 2017 10:06:51 GMT bouncer Error during init!
bouncer_1 | Error: rtm.start missing params:
bouncer_1 | - token ... Authentication token.
bouncer_1 | Requires scope: client

Store user access token after login

When we store a user's access token in the session, we could use it later on.

  • Evaluate what "safe and secure" should entail.
  • Check whether this makes sense when only asking for /authenticate because according to to the scope documentation

From the ORCID documentation: https://members.orcid.org/api/integrate/orcid-sign-in

ORCID will then return the researcher’s verified ORCID iD and an access token, along with the refresh token, scope(s), name on the ORCID record, and token expiry. A example response:

   {"access_token":"f5af9f51-07e6-4332-8f1a-c0c11c1e3728","token_type":"bearer",
   "refresh_token":"f725f747-3a65-49f6-a231-3e8944ce464d","expires_in":631138518,
   "scope":"/authorize","name":"Sofia Garcia","orcid":"0000-0001-2345-6789"}

Store the ORCID iD and access token in your system in a safe and secure manner. Both items will be required to perform any action to their ORCID record: read, write, update. If you are only requesting /authorize access, access tokens can be stored to indicate that the iD has been authenticated, as well as to read public access data.

Use the ORCID iD and access token to read the user’s record and populate their profile in your system: Save users time by allowing them to quickly and easily transfer data from their ORCID records to your system. All you need to is to make a quick call to their record:

  Method: GET
  Content-type: application/vnd.orcid+xml or application/vnd.orcid+json
  Authorization type: Bearer
  Access token: [Stored access token]
  End point: https://api.sandbox.orcid.org/v2.0/[Stored ORCID iD]/record
  Example record XML: GitHub

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.