Skip to content

Commit 6df6e6e

Browse files
authored
Merge pull request #698 from Kitware/improve-auth-docs
docs: add CORS note to tokenUrl
2 parents 15473d8 + 6a1434f commit 6df6e6e

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

docs/.vitepress/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export default defineConfig({
5959
{ text: 'Overview', link: '/deployment_overview' },
6060
{ text: 'Building for Production', link: '/building_for_production' },
6161
{ text: 'Deploying VolView', link: '/deploying_volview' },
62-
{ text: 'Authentication', link: '/authentication' },
62+
{ text: 'Authentication & Authorization', link: '/authentication' },
6363
{ text: 'Cross Origin Resource Sharing (CORS)', link: '/cors' },
6464
],
6565
},

docs/authentication.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Authentication
1+
# Authentication & Authorization
22

33
VolView itself does not specify any given authentication mechanism to use. How you let VolView access authenticated resources depends on individual deployment needs.
44

@@ -21,4 +21,9 @@ You can pass in the `token` URL parameter like so: `https://example.com/VolView/
2121

2222
As an alternative to passing in the token via the URL, if you have an endpoint that returns the user's token then you can use the `tokenUrl` parameter like so: `https://example.com/VolView/?tokenUrl=https://example.com/userToken`. If VolView successfully receives a token from this endpoint, it will use the token in subsequent data requests.
2323

24-
By default, VolView will make a `GET` request to the token URL. If another type of request is needed, you can configure it via the `tokenUrlMethod` parameter. For example, to make a `POST` request: `https:/example.com/VolView/?tokenUrl=https://example.com/userToken&tokenUrlMethod=POST`.
24+
The token URL is expected to return the access token as plaintext, i.e. `text/plain`. Please note that you cannot use an OAuth token endpoint here! OAuth token endpoints are used to exchange auth information, while `tokenUrl` must return just the access token under an already-authenticated session.
25+
26+
By default, VolView will make a `GET` request to the token URL. If another type of request is needed, you can configure it via the `tokenUrlMethod` parameter. For example, to make a `POST` request: `https:/example.com/VolView/?tokenUrl=https://example.com/userToken&tokenUrlMethod=POST`.
27+
28+
> [!NOTE]
29+
> This requires CORS to be properly configured for the token URL endpoint. See the [CORS](/cors) documentation for more info.

docs/cors.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ Please see [the deployment docs](/deploying_volview) for more info on what an ex
1818
server {
1919
...
2020
21-
add_header Access-Control-Allow-Origin "example.com"
21+
# Replace "volview.kitware.app" with the domain on which
22+
# VolView is being hosted.
23+
add_header Access-Control-Allow-Origin "volview.kitware.app"
2224
}
2325
```
2426

0 commit comments

Comments
 (0)