iTwin / itwinjs-core

Monorepo for iTwin.js Library
https://www.itwinjs.org
MIT License
615 stars 210 forks source link

How to get Access Token? #1480

Closed ashish-srivastava-dev closed 3 years ago

ashish-srivastava-dev commented 3 years ago

In version 2.4.0, I used DesktopAuthorizationClientConfiguration and DesktopAuthorizationClient to get the access token, but in 2.15.5 they have been deprecated. Could you please point me to some sample code that gets access token (in version 2.15.5) for a nodejs command line app?


⚠ Do not edit this section. It is required for imodeljs.github.io ➟ GitHub issue linking

kabentley commented 3 years ago

see example here

ashish-srivastava-dev commented 3 years ago

I have tried this code, but it is giving unauthorized error.

ramanujam-raman-zz commented 3 years ago

The code on the surface looks OK - can you check the scope? In the commented out version you seem to use - scope: this.getenvVariables().scope. Is that the value you have the new version of the code?

ashish-srivastava-dev commented 3 years ago

This is resolved. Thanks.