https://github.com/becodeorg/oto
⚙️ Oto, the man in the middle - OAuth2 middleware lambda
https://github.com/becodeorg/oto
internal-tool
Last synced: 12 months ago
JSON representation
⚙️ Oto, the man in the middle - OAuth2 middleware lambda
- Host: GitHub
- URL: https://github.com/becodeorg/oto
- Owner: becodeorg
- Created: 2019-06-03T00:06:01.000Z (about 7 years ago)
- Default Branch: develop
- Last Pushed: 2022-02-14T10:44:42.000Z (over 4 years ago)
- Last Synced: 2025-03-24T21:04:13.430Z (about 1 year ago)
- Topics: internal-tool
- Language: JavaScript
- Homepage:
- Size: 4.99 MB
- Stars: 3
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# BeCode: oto
> ⚙️ Oto, the man in the middle - OAuth2 middleware lambda
* * *
## About
_By design_, you cannot use **OAuth2** without a server, since you need to store a _secret key_ from the provider.
In a world full of PWA and static websites, it´s a _bummer_.
**oto** is a small middleware, a lambda serverless function, which only role is to serve as the server in a OAuth2 transaction.
[Read the **dev.to** article](https://dev.to/leny/introducing-oto-the-man-in-the-middle-52go) introducing oto & its purpose.
## Installation
Firstly, run the classic `npm install` to install dependencies.
You will also need to create the file `env/sls.env.json`, following this structure:
```json
{
"dev": {
"PROVIDER_ACCESSID": "ACCESSKEY",
"PROVIDER_ACCESSID": "ACCESSKEY"
}
}
```
It can contains as many values as you want (like for different stages of development).
The `PROVIDER` value is the service to connect, like `github` ; `ACCESSID` is the *public* access id given by the service ; `ACCESSKEY` is the *private* access key given by the service.
Example:
```json
{
"dev": {
"github_xxxxxx": "xyzxyzxyzxyz"
}
}
```
### Supported providers
- [x] `github`
- [x] `linkedin`
- [ ] `google`
## Usage
Run `npm run build` to build the code, or `npm run work` to watch the changes and rebuild.
Run `npm run dev` to create a local host serving the lambda, on port `6060`.
### Deployment
You need to have [setup](https://serverless.com/framework/docs/providers/aws/guide/credentials/) the appropriate user from AWS and stored it in your `~/.aws/credentials`.
#### Dev deployment
npm run deploy:dev --aws-profile=
#### Production deployment
npm run deploy:prod --aws-profile=
* * *
> 🤟 You are working on a project for BeCode and want to use **oto**?
> Contact **My Becode Team** `my@becode.org` via email to inject your app's credentials and use our instances!
* * *
My Becode Team