Skip to content

Commit

Permalink
Changed the default for NB_ENABLE_AUTH from true to false
Browse files Browse the repository at this point in the history
  • Loading branch information
rmanaem committed Jul 12, 2024
1 parent aa95d9d commit ea1c916
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ but before proceeding with either you need to set the environment variables.
### Mandatory configuration

| Environment variable | Type | Required | Default value if not set | Example |
| -------------------- | ------- | -------------------------------------- | ------------------------ | ------------------------------------------------------- | --- |
| -------------------- | ------- | -------------------------------------- | ------------------------ | ------------------------------------------------------- |
| NB_API_QUERY_URL | string | Yes | - | https://federate.neurobagel.org/ |
| NB_IS_FEDERATION_API | boolean | No | true | true |
| NB_ENABLE_AUTH | boolean | no | true | true |
| NB_QUERY_CLIENT_ID | string | Yes (if NB_ENABLE_AUTH is set to true) | - | 46923719231972-dhsahgasl3123.apps.googleusercontent.com | |
| NB_ENABLE_AUTH | boolean | no | false | false |
| NB_QUERY_CLIENT_ID | string | Yes (if NB_ENABLE_AUTH is set to true) | - | 46923719231972-dhsahgasl3123.apps.googleusercontent.com |

#### `NB_API_QUERY_URL`

Expand All @@ -64,7 +64,7 @@ If the API you'd like to send queries to is not a [federation api](https://neuro

#### `NB_ENABLE_AUTH`

If the API you'd like to send queries to doesn't require authentication, you can to set `NB_ENABLE_AUTH` to `false` as it is `true` by default. This will disable authentication flow of the app.
If the API you'd like to send queries to requires authentication, you need to set `NB_ENABLE_AUTH` to `true` as it is `false` by default. This will enable authentication flow of the app.

#### `NB_QUERY_CLIENT_ID`

Expand All @@ -86,6 +86,14 @@ if you're using the remote (in this example federation) api, your `.env` file wo
NB_API_QUERY_URL=https://federate.neurobagel.org/
```

if you're using a federation api with authentication, your `.env` file would look something like this:

```bash
NB_API_QUERY_URL=https://federate.neurobagel.org/
NB_ENABLE_AUTH=true
NB_QUERY_CLIENT_ID=46923719231972-dhsahgasl3123.apps.googleusercontent.com
```

:warning: The protocol matters here.
If you wish to use the Neurobagel remote API, ensure your `NB_API_QUERY_URL` uses `https` instead of `http`.

Expand Down
2 changes: 1 addition & 1 deletion src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const isFederationAPI: boolean =

export const enableAuth: boolean =
import.meta.env.NB_ENABLE_AUTH === undefined
? true
? false
: import.meta.env.NB_ENABLE_AUTH.toLowerCase() === 'true';

export const clientID: string = import.meta.env.NB_QUERY_CLIENT_ID ?? '';
Expand Down

0 comments on commit ea1c916

Please sign in to comment.