Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hugojosefson/lifelog-auth-example
Example of accessing a user's profile in Lifelog with OAuth2 authorization.
https://github.com/hugojosefson/lifelog-auth-example
Last synced: 29 days ago
JSON representation
Example of accessing a user's profile in Lifelog with OAuth2 authorization.
- Host: GitHub
- URL: https://github.com/hugojosefson/lifelog-auth-example
- Owner: hugojosefson
- Created: 2015-12-14T13:20:23.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-12-15T15:58:06.000Z (about 9 years ago)
- Last Synced: 2024-09-17T01:24:33.504Z (4 months ago)
- Language: JavaScript
- Homepage: https://github.com/hugojosefson/lifelog-auth-example#readme
- Size: 3.91 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# lifelog-auth-example
Example of accessing a user's profile in Lifelog with OAuth2 authorization.
## Installation
```bash
git clone https://github.com/hugojosefson/lifelog-auth-example
cd lifelog-auth-example
npm install
```## Prerequisites
### Hosted on an https URL
The app needs to be run on an https URL.
One way of achieving this during development or for quick testing, is by
running the app locally on your laptop, and using
[localtunnel.me](https://localtunnel.me/) to let anyone access it:```bash
export LOCALTUNNEL_SUBDOMAIN=yourname
npm run localtunnel
```### An application registered with Sony Developer World
Log in and create an application at
[developer.sony.com/develop/services/lifelog-api/create-app/](https://developer.sony.com/develop/services/lifelog-api/create-app/).Configure its *Callback URL* so that it reflects the localtunnel name you used
above. For example, if you set up localtunnel with the name `yourname`, this
is the correct *Callback URL*:```
https://yourname.localtunnel.me/callback
```#### The Client ID and Secret
Save the *Client ID* and *Secret* you are given when registering the
application. If you forget the secret, simply click *Add credentials* to get a
new set of credentials.## Running
```bash
export BASE_URI=https://your.server.tld # The https URL where your site is available. Like Callback URL, but without /callback
export PORT=3000 # to optionally set which port your server should listen on (default is 3000)
export CLIENT_ID=your_client_id # The Client ID you received from Developer World when creating your app.
export CLIENT_SECRET=your_client_secret # The Client Secret you received from Developer World when creating your app.
npm start
```If you are using `localtunnel`, you can use `LOCALTUNNEL_SUBDOMAIN` instead of `BASE_URI` if you want:
```bash
export LOCALTUNNEL_SUBDOMAIN=yourname
export PORT=3000 # to optionally set which port your server should listen on (default is 3000)
export CLIENT_ID=your_client_id # The Client ID you received from Developer World when creating your app.
export CLIENT_SECRET=your_client_secret # The Client Secret you received from Developer World when creating your app.
npm start
```