Class Authorization


public class Authorization extends AuthResource
Resource for authorization calls for bearer and refresh tokens.
  • Constructor Details

    • Authorization

      public Authorization(FreshBooksClient freshBooksClient)
      Parameters:
      freshBooksClient - Initialized instance of FreshBooksClient
  • Method Details

    • getAuthRequestUri

      public String getAuthRequestUri(String authorizationUrl, String clientId, String clientSecret, String redirectUri, List<String> scopes)
      Returns the url that a client needs to request an oauth grant from the server.
      Parameters:
      scopes - List of scopes if your want an access token with only a subset of your registered scopes.
      Returns:
      The URL for the authorization request
    • getToken

      public AuthorizationToken getToken(Map<String,Object> content) throws FreshBooksException
      Get the currently authorized identity from the FreshBooks /me endpoint.
      Returns:
      Identity of the authorized user.
      Throws:
      FreshBooksException - If the call is not successful