Class Authorization
java.lang.Object
net.amcintosh.freshbooks.resources.api.Resource
net.amcintosh.freshbooks.resources.api.AuthResource
net.amcintosh.freshbooks.resources.Authorization
Resource for authorization calls for bearer and refresh tokens.
-
Field Summary
Fields inherited from class net.amcintosh.freshbooks.resources.api.Resource
freshBooksClient
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetAuthRequestUri
(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.Get the currently authorized identity from the FreshBooks /me endpoint.Methods inherited from class net.amcintosh.freshbooks.resources.api.AuthResource
getResourceType, getUrl, handleRequest, handleRequest
Methods inherited from class net.amcintosh.freshbooks.resources.api.Resource
buildQueryString
-
Constructor Details
-
Authorization
- 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
Get the currently authorized identity from the FreshBooks /me endpoint.- Returns:
- Identity of the authorized user.
- Throws:
FreshBooksException
- If the call is not successful
-