Skip to content

Commit

Permalink
Implement app authentication flow
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanNienhuis committed Jun 7, 2022
1 parent 636a396 commit fd9b87d
Show file tree
Hide file tree
Showing 47 changed files with 19,995 additions and 256 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ An example configuration can be found in the [config.example.json](config.exampl
| `accessToken` | `string` | **Required**<br/>Access token for the Bold API. |
| `refreshToken` | `string` | **Required**<br/>Refresh token for the Bold API. |

## Backend

The `backend/` folder contains the source code for the backend that is used while authenticating using the Bold app (default authentication). I host this myself on AWS. While your password is never available to this server, you can choose to self host this backend if you obtain a client id and secret from Bold. Specify a custom backend by clicking the settings icon on the login page.

Alternatively you can also choose to use Legacy Authentication using username/password if you prefer not to use either of these options. This will log out your Bold app as only one username/password session can be active at the same time.

## Credits

Thanks to [Erik Nienhuis](https://github.com/ErikNienhuis) for helping with reverse-engineering the Bold API and providing me with the Bold API documentation.
45 changes: 45 additions & 0 deletions backend/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"env": {
"es2021": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"indent": [
"error",
4,
{
"MemberExpression": "off"
}
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"single",
{
"avoidEscape": true
}
],
"semi": [
"error",
"always"
],
"prefer-const": [
"off"
]
}
}
7 changes: 7 additions & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
### Serverless ###
# Ignore build directory
.serverless
.serverless-offline

.env.production
.env.staging
3 changes: 3 additions & 0 deletions backend/example.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
BOLD_CLIENT_ID=HomeBridge
BOLD_CLIENT_SECRET=<client secret>
BOLD_REDIRECT_URI=https://bold.nienhuisdevelopment.com/oauth/callback
Loading

0 comments on commit fd9b87d

Please sign in to comment.