You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
import {
BrowserAuthorizationClient,
BrowserAuthorizationClientConfiguration,
} from '@itwin/browser-authorization';
import { appConfig } from './AppConfigService';
class AuthorizationService {
private _authorizationClient: BrowserAuthorizationClient | undefined;
private async createAuthorizationClient(): Promise<
BrowserAuthorizationClient
> {
const authorizationClientConfiguration: BrowserAuthorizationClientConfiguration = {
authority: appConfig.auth.authority,
clientId: appConfig.auth.clientId,
redirectUri: appConfig.auth.redirectUrl,
postSignoutRedirectUri: undefined,
scope: appConfig.auth.scopes,
responseType: 'code',
};
const client = new BrowserAuthorizationClient(
authorizationClientConfiguration,
);
return client;
}
public async getAccessToken(): Promise<string> {
if (!this._authorizationClient) {
this._authorizationClient = await this.createAuthorizationClient();
try {
await this._authorizationClient.signIn();
} catch (err) {
throw {
message: err,
};
}
}
return this._authorizationClient.getAccessToken();
}
}
export const authorizationService = new AuthorizationService();
Hi All,
I'm trying to find out why the authorization client does not return anything when the signIn method is called, but i get the following response that is difficult to understand:
{"message":"failed to retrieve issues","error":{"message":{}}}
As you can see, it does not seem to return any error message. Any ideas how I can find out the cause of the error and how to resolve it?
The text was updated successfully, but these errors were encountered:
I would check the browser dev console and network logs. In most case, we do not swallow errors. When we do, the error message is direct as to the cause on our end, though I do see a couple areas we could improve.
Perhaps the unclear error is from your identity provider.
Hi All,
I'm trying to find out why the authorization client does not return anything when the signIn method is called, but i get the following response that is difficult to understand:
{"message":"failed to retrieve issues","error":{"message":{}}}
As you can see, it does not seem to return any error message. Any ideas how I can find out the cause of the error and how to resolve it?
The text was updated successfully, but these errors were encountered: