Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@itwin/service-authorization

Package Overview
Dependencies
Maintainers
0
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@itwin/service-authorization

Service authorization client for iTwin platform

  • 1.2.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
13K
decreased by-0.71%
Maintainers
0
Weekly downloads
 
Created
Source

@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.

FAQs

Package last updated on 16 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc