Skip to content

Latest commit

 

History

History
25 lines (15 loc) · 1.22 KB

README.md

File metadata and controls

25 lines (15 loc) · 1.22 KB

@itwin/node-cli-authorization

Copyright © Bentley Systems, Incorporated. All rights reserved. See LICENSE.md for license terms and full copyright notice.

Description

The @itwin/node-cli-authorization package contains a Node.js command-line based client for authorization with the iTwin Platform by default and is configurable to work with any OAuth2.0 based provider.

How it works

The OAuth2.0 workflow used in this package is Authorization Code + PKCE, for more information about the flow please visit the Authorization Overview Page.

How to setup

Choose "Desktop/Mobile" as your application type when registering for use with this client.

Note that your registered application's redirectUri must start with http://localhost:${redirectPort}.

See the AccessToken article in the iTwin.js documentation for background on authorization in iTwin.js.

const authClient = new NodeCliAuthorizationClient(yourConfig);
await authClient.signIn();
IModelHost.authorizationClient = authClient;