1.2.2 • Published 1 year ago

@itwin/service-authorization v1.2.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@itwin/service-authorization

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

Description

The @itwin/service-authorization package contains a service based client for authorization with the iTwin platform using OIDC client credentials flow.

Usage

const client = new ServiceAuthorizationClient(serviceConfiguration: ServiceAuthorizationClientConfiguration)
// retrieve a new access token
const token = await client.getAccessToken()

ServiceAuthorizationClientConfiguration

PropertyTypeDescriptionRequiredDefault
clientIdstringClient application's identifier as registered with the Bentley IMS OIDC/OAuth2 provider.truenone
clientSecretstringClient application's secret key as registered with the Bentley IMS OIDC/OAuth2 provider.truenone
scopestringList of space separated scopes to request access to various resources.truenone
authority?stringThe URL of the OIDC/OAuth2 provider. If left undefined, the iTwin Platform authority (ims.bentley.com) will be used by default.false"ims.bentley.com"

ServiceAuthorizationClient

NameTypeDescription
getAccessToken() => Promise\<string>Returns the access token.
hasExpiredbooleanReturns true if the access token has expired.
hasSignedInbooleanReturns true if signed in - the accessToken may be active or may have expired and require a refresh
isAuthorizedbooleanReturns true if there's a current authorized client Set to true if signed in and the access token has not expired, and false otherwise.

For information about the service authorization workflow please visit the Authorization Overview Page.

1.2.2

1 year ago

1.2.1

1 year ago

1.2.0

1 year ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.3

2 years ago

1.0.0

2 years ago

0.8.0

2 years ago

0.6.3

3 years ago

0.7.0

3 years ago

0.6.2

3 years ago

0.6.1

3 years ago

0.6.0

3 years ago

0.5.0

4 years ago

0.4.0

4 years ago

0.3.0

4 years ago

0.2.0

4 years ago

0.1.0

4 years ago