Skip to content

fix ApiClient.setAccessToken #225

Description

@christian-frei

currently the method is of no use:

  /**
   * Helper method to set access token for the first OAuth2 authentication.
   *
   * @param accessToken Access token
   */
  public void setAccessToken(String accessToken) {
    throw new RuntimeException("No OAuth2 authentication configured!");
  }

I propose to make it a convenience method as follows:

  public void setAccessToken(String accessToken) {
    this.addDefaultHeader("Authorization", "Bearer " + accessToken);
  }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions