Skip to content

Commit

Permalink
basic 3-legged auth
Browse files Browse the repository at this point in the history
  • Loading branch information
pan261 committed Nov 2, 2021
1 parent 5ef7021 commit d586ec3
Show file tree
Hide file tree
Showing 5 changed files with 1,893 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
.vscode
14 changes: 14 additions & 0 deletions config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
// Set environment variables or hard-code here
credentials: {
client_id: process.env.FORGE_CLIENT_ID,
client_secret: process.env.FORGE_CLIENT_SECRET,
callback_url: process.env.FORGE_CALLBACK_URL
},
scopes: {
// Required scopes for the server-side application
internal: ['bucket:create', 'bucket:read', 'data:read', 'data:create', 'data:write'],
// Required scope for the client-side viewer
public: ['viewables:read']
}
};
Loading

1 comment on commit d586ec3

@pan261
Copy link
Contributor Author

@pan261 pan261 commented on d586ec3 Nov 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For setting up the server:

  1. run npm install in the root dir

  2. create a .vscode folder with a launch.json file, and add the following:

{
  "version": "0.2.0",
  "configurations": [
    {
      "command": "cd ${workspaceFolder}\nnpm start",
      "name": "Launch Server",
      "request": "launch",
      "type": "node-terminal",
      "env": {
        "FORGE_CLIENT_ID": "[your client id]",
        "FORGE_CLIENT_SECRET": "[your client secret]",
        "FORGE_CALLBACK_URL": "http://localhost:3000/callback/"
      }
    }
  ]
}
  • this should allow you to use the VSCode "run and debug" tab to run the server
  1. make sure the callback url is the same inside your forge project

  2. run the server from VSCode
    image

Now just navigate to localhost:3000/auth

Please sign in to comment.