new CloverOAuth(configuration)
Library to facilitate OAuth authentication.
All of the Clover rest calls will require that the application has an oauth token. This
object makes obtaining and using a token clearer.
The constructor sets up the object, and may throw an error if the clientId is not present on the
passed configuration.
Parameters:
Name | Type | Description |
---|---|---|
configuration |
map | an object of the form { "clientId": the_id_for_your_clover_application, required "domain" : the clover server url. if unset, defaulted to CloverOAuth.defaultDomain } |
- Source:
Members
(static) defaultDomain
the default clover domain/url
- Source:
Methods
getAccessToken()
Attempt to get the security token
This function attempts to extract an OAuth token from the
request/response.
It will create/set the userInfo object with associated keys.
- Source:
getOAuthURL(redirectopt) → {string}
Build the oauth url
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
redirect |
string |
<optional> |
the url to redirect to after authentication. Must be CORS acceptable. |
- Source:
Returns:
the oauth url.
- Type
- string
getURLParams()
Get the url parameters from the proper url.
- Source:
getURLParamsFromURL()
Grab the parameters from the url search string.
- Source:
hasAccessToken()
Attempt to get the security token
This function attempts to extract an OAuth token from the
request/response.
It will create/set the userInfo object with associated keys.
- Source:
parseTokenFromURLHash()
When running inside a browser, we grab the access token from the hash
- Source: