How to use the @openid/appauth.AuthorizationRequest.RESPONSE_TYPE_CODE function in @openid/appauth

To help you get started, we’ve selected a few @openid/appauth examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pingidentity / angular-spa-sample / src / app / authorization.service.ts View on Github external
.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);
    });
  }
github imodeljs / imodeljs / core / clients-backend / src / oidc / OidcDeviceClient.ts View on Github external
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,