Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.subscribe((configuration: AuthorizationServiceConfiguration) => {
const scope = this.environment.scope || 'openid';
// create a request
const request = new AuthorizationRequest({
client_id: this.environment.client_id,
redirect_uri: this.environment.redirect_uri,
scope: scope,
response_type: AuthorizationRequest.RESPONSE_TYPE_CODE,
extras: this.environment.extras
});
this.authorizationHandler.performAuthorizationRequest(configuration, request);
});
}
private makeAuthorizationRequest(requestContext: ClientRequestContext) {
requestContext.enter();
if (!this._configuration)
throw new BentleyError(AuthStatus.Error, "Not initialized. First call initialize()", Logger.logError, loggerCategory);
const reqJson: AuthorizationRequestJson = {
response_type: AuthorizationRequest.RESPONSE_TYPE_CODE,
client_id: this._clientConfiguration.clientId,
redirect_uri: this._clientConfiguration.redirectUri,
scope: this._clientConfiguration.scope,
extras: { prompt: "consent", access_type: "offline" },
};
const request = new AuthorizationRequest(
reqJson,
undefined /* state */,
true, /* usePkce */
);
Logger.logTrace(loggerCategory, "Making authorization request", () => ({ configuration: this._configuration, request }));
this._requestContext = requestContext;
this._authorizationHandler.performAuthorizationRequest(
this._configuration,
request,