Skip to content

Commit

Permalink
Updated .env files in CRA templates to have the itwin-platform scope (
Browse files Browse the repository at this point in the history
#333)

* Updated .env in CRA templates to have `itwin-platform` scope

* changelog

* rush update --full

* Revert "rush update --full"

This reverts commit 2bd9a13.

* pnpm overrides for packages with high severity vulnerabilities
  • Loading branch information
MindaugasButkus authored Oct 31, 2024
1 parent 6e25f81 commit b3e5924
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 39 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@itwin/cra-template-desktop-viewer",
"comment": "Updated .env file in CRA template to have the `itwin-platform` scope.",
"type": "patch"
}
],
"packageName": "@itwin/cra-template-desktop-viewer"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@itwin/cra-template-web-viewer",
"comment": "Updated .env file in CRA template to have the `itwin-platform` scope.",
"type": "patch"
}
],
"packageName": "@itwin/cra-template-web-viewer"
}
4 changes: 3 additions & 1 deletion common/config/rush/pnpm-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"braces": "^3.0.3",
"path-to-regexp@>=0.2.0": "^8.0.0",
"path-to-regexp@<0.1.10": "^0.1.10",
"postcss": "^8.4.31"
"postcss": "^8.4.31",
"http-proxy-middleware": "^2.0.7",
"rollup": "^2.79.2"
}
}
50 changes: 26 additions & 24 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ---- Configuration ----
ITWIN_VIEWER_SCOPE ="imodelaccess:read offline_access imodels:read itwins:read realitydata:read"
ITWIN_VIEWER_SCOPE ="itwin-platform offline_access"
ITWIN_VIEWER_CLIENT_ID=""
ITWIN_VIEWER_REDIRECT_URI=""
ITWIN_VIEWER_ISSUER_URL="https://ims.bentley.com"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@ ITWIN_VIEWER_CLIENT_ID="native-xxxxxxxx"

- You should generate a [client](https://developer.bentley.com/register/) to get started. The client that you generate should be for a desktop app and use the following list of apis. You can add the default redirect uri (http://localhost:3000/signin-callback).

- Scopes expected by the viewer are:

- **Visualization**: `imodelaccess:read`
- **iModels**: `imodels:read`
- **Reality Data**: `realitydata:read`
- **Administration**: `itwins:read`
- Viewer expects the `itwin-platform` scope to be set.

## Available Scripts

Expand Down
2 changes: 1 addition & 1 deletion packages/templates/cra-template-web-viewer/template/.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
IMJS_AUTH_CLIENT_CLIENT_ID = ""
IMJS_AUTH_CLIENT_REDIRECT_URI = ""
IMJS_AUTH_CLIENT_LOGOUT_URI = ""
IMJS_AUTH_CLIENT_SCOPES ="imodelaccess:read imodels:read realitydata:read"
IMJS_AUTH_CLIENT_SCOPES ="itwin-platform"
IMJS_AUTH_AUTHORITY="https://ims.bentley.com"

# ---- Test ids ----
Expand Down
8 changes: 2 additions & 6 deletions packages/templates/cra-template-web-viewer/template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,12 @@ Prior to running the app, you will need to add OIDC client configuration to the
IMJS_AUTH_CLIENT_CLIENT_ID=""
IMJS_AUTH_CLIENT_REDIRECT_URI=""
IMJS_AUTH_CLIENT_LOGOUT_URI=""
IMJS_AUTH_CLIENT_SCOPES =""
IMJS_AUTH_CLIENT_SCOPES=""
```

- You can generate a [test client](https://developer.bentley.com/tutorials/web-application-quick-start/#3-register-an-application) to get started.

- Scopes expected by the viewer are:

- **Visualization**: `imodelaccess:read`
- **iModels**: `imodels:read`
- **Reality Data**: `realitydata:read`
- Viewer expects the `itwin-platform` scope to be set.

- The application will use the path of the redirect URI to handle the redirection, it must simply match what is defined in your client.

Expand Down

0 comments on commit b3e5924

Please sign in to comment.