Overdrivr / micro-ci

Continuous Integration for embedded platforms
0 stars 0 forks source link

Use session data to setup access token #96

Closed Overdrivr closed 8 years ago

Overdrivr commented 8 years ago

PassportJS places authentication data inside a session. This means the accessToken obtained through OAuth is contained inside this session.

To make authenticated requests on our app, this accessToken should be copied from req.session.passport to Authorization header of the request.

Writing a simple middleware is perfect for the job.

Once this is done, it will be possible to enjoy the full ACL system of loopback and make authenticated requests from a OAuth authenticated user.