import { AccessToken , BeEvent } from "@itwin/core-bentley" ; import { AuthorizationClient } from "@itwin/core-common" ; internal export class IModelBankDummyAuthorizationClient implements AuthorizationClient { private _token : AccessToken = "" ; public constructor ( private _userCredentials ) { } public async signIn ( ) { const userInfo = { id : "" , email : { id : this . _userCredentials . email } , profile : { name : "" , firstName : "" , lastName : "" } } ; const foreignAccessTokenWrapper = { } ; foreignAccessTokenWrapper . ForeignProjectAccessToken = { userInfo } ; this . _token = JSON . stringify ( foreignAccessTokenWrapper ) ; this . onAccessTokenChanged . raiseEvent ( this . _token ) ; } public async signOut ( ) { this . _token = "" ; this . onAccessTokenChanged . raiseEvent ( this . _token ) ; } public readonly onAccessTokenChanged = new BeEvent < ( token : AccessToken ) => void > ( ) ; public get isAuthorized ( ) : boolean { return this . _token !== "" ; } public get hasExpired ( ) : boolean { return false ; } public get hasSignedIn ( ) : boolean { return this . _token !== "" ; } public async getAccessToken ( ) { return this . _token ; } }