Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated .env files in CRA templates to have the itwin-platform scope #333

Merged
merged 5 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Loading