diff --git a/packages/oidc-signin-tool/src/certa/certaBackend.ts b/packages/oidc-signin-tool/src/certa/certaBackend.ts index 7839ea59..196239c9 100644 --- a/packages/oidc-signin-tool/src/certa/certaBackend.ts +++ b/packages/oidc-signin-tool/src/certa/certaBackend.ts @@ -7,10 +7,11 @@ import * as fs from "fs"; import * as path from "path"; import type { AccessToken } from "@itwin/core-bentley"; import { registerBackendCallback } from "@itwin/certa/lib/utils/CallbackUtils"; -import { ServiceAuthorizationClient, ServiceAuthorizationClientConfiguration } from "@itwin/service-authorization"; +import type { ServiceAuthorizationClientConfiguration } from "@itwin/service-authorization"; +import { ServiceAuthorizationClient } from "@itwin/service-authorization"; import type { TestBrowserAuthorizationClientConfiguration, TestUserCredentials } from "../TestUsers"; import { TestUtility } from "../TestUtility"; -import { getTokenCallbackName, getServiceAuthTokenCallbackName } from "./certaCommon"; +import { getServiceAuthTokenCallbackName, getTokenCallbackName } from "./certaCommon"; // A backend to use within Certa's `backendInitModule` to setup OIDC sign-in. @@ -57,7 +58,6 @@ async function signin(user: TestUserCredentials, oidcConfig?: TestBrowserAuthori if (undefined === token) throw new Error("Failed to get access token"); - return token; } @@ -78,7 +78,6 @@ registerBackendCallback( }, ); - registerBackendCallback(getServiceAuthTokenCallbackName, async (oidcConfig: ServiceAuthorizationClientConfiguration): Promise => { return signinWithServiceAuthClient(oidcConfig); -}); \ No newline at end of file +}); diff --git a/packages/oidc-signin-tool/src/certa/certaCommon.ts b/packages/oidc-signin-tool/src/certa/certaCommon.ts index c11eb209..e4adc66b 100644 --- a/packages/oidc-signin-tool/src/certa/certaCommon.ts +++ b/packages/oidc-signin-tool/src/certa/certaCommon.ts @@ -18,8 +18,10 @@ export async function getAccessTokenFromBackend(user: TestUserCredentials, oidcC return accessToken; } - +/** + * Retrieves a service authorization token from the backend. + */ export async function getServiceAuthTokenFromBackend(oidcConfig: ServiceAuthorizationClientConfiguration): Promise { const accessToken = await executeBackendCallback(getServiceAuthTokenCallbackName, oidcConfig); return accessToken; -} \ No newline at end of file +}