Need guidance on using iTwin Platform APIs #1699
-
I am interested in using iTwin Platform services (project, issues, form,...) I played around with the API in developer.bentley.com and all requests seem to interacting with my projects/users/issues as expected. To understand how to access these services from within my app, I added a function to myFirstUiProvider() app with a simple request (following the code in Platform API clash review example). Please see response below. Any guidance on what I need to do to get this working (add appropriate access control in my request?). private static onRequest = async () => { // this function is invoked with a added to myFirstUiProvider widget
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 12 replies
-
Just to confirm:
|
Beta Was this translation helpful? Give feedback.
-
Hello Arun, @aruniverse Can you provide instructions on how to do the same thing for an app created from the sample desktop-starter ? Thanks, John M. |
Beta Was this translation helpful? Give feedback.
-
Thank you Arun for fixing this issue and letting me know. I will look
into this shortly.
We want to replace default authentication process with our own (as all
our users are already authenticated by our service). We have been
studying documentation on iTwin authentication, but if there an example
code for this, would really appreciate if you can point me to that, or
any guidance on architecture/workflow to follow.
Thank you,
Ovais
…------ Original Message ------
From: "Arun George" ***@***.***>
To: "imodeljs/imodeljs" ***@***.***>
Cc: "ovaisa" ***@***.***>; "Author"
***@***.***>
Sent: 8/6/2021 7:00:45 PM
Subject: Re: [imodeljs/imodeljs] Need guidance on using iTwin Platform
APIs (#1699)
Hey, just wanted to update you, not sure if you saw the post below
about desktop, but the same can be applied to the web here.
You can now remove the AuthorizationClient I had shared with you
earlier.
If you go to your app on the developer portal,
developer.bentley.com/apps/spa/{whatever-your-spa-client-id-is}, you
should find the new itwinjs scope under the Visualization section, add
that, and update your web app.
Now you just need to use 1 client, using https://ims.bentley.com as the
authority as long as you have the itwinjs scope.
constauthConfig: BrowserAuthorizationClientConfiguration={authority: "https://ims.bentley.com",scope: process.env.IMJS_AUTH_CLIENT_SCOPES??"",clientId: process.env.IMJS_AUTH_CLIENT_CLIENT_ID??"",redirectUri: process.env.IMJS_AUTH_CLIENT_REDIRECT_URI??"",postSignoutRedirectUri: process.env.IMJS_AUTH_CLIENT_LOGOUT_URI,responseType: "code"};<ViewerauthConfig={{config: authConfig}}
...
/>
And now you can obtain a token like so:
awaitIModelApp.authorizationClient?.getAccessToken()
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1699 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ATZJRX2FA74YLK2X66L66KLT3PTI3ANCNFSM47FTR2RA>.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email>.
|
Beta Was this translation helpful? Give feedback.
@laurynasr ?
Just to confirm: