kloudless.application
- Oauth methods¶
-
kloudless.application.
verify_token
(app_id, token)¶ Verify whether the
token
belongs to Application withapp_id
.Refer to Verify the token for more information.
Parameters: - app_id (str) – Application ID
- token (str) – Account’s Bearer token
Returns: (dict) Token information
Raise:
Get the url to start the first leg of OAuth flow.
Refer to Authentication Docs for more information.
Parameters: - app_id (str) – Application ID
- redirect_uri (str) – Redirect URI to your application server
- scope (str) – A space-delimited string of scopes that indicate which services a user can connect, and which permissions to request
- state (str) – An arbitrary string which would be redirected back via
redirect_uri
as query parameter. Random url-safe Base64 string would be generated by default - extra_data (str) – A URL-encoded JSON object containing data used to pre-fill default values for fields in the Kloudless authentication forms. For example, the domain of a WebDAV server
- params – Additional query parameters
Returns: tuple(url, state): Redirect the user to
url
to start authorization. Savedstate
in user’s session for future validationReturn type: tuple(str, str)
-
kloudless.application.
get_token_from_code
(app_id, api_key, orig_state, orig_redirect_uri, **params)¶ Retrieve bearer token from authorization code.
Parameters: - app_id (str) – Application ID
- api_key (str) – API Key
- orig_state (str) –
state
fromkloudless.application.get_authorization_url()
call - orig_redirect_uri (str) –
redirect_uri
used while callingkloudless.application.get_authorization_url()
- params – The included query parameters while Kloudless redirects user to Redirect URI of your application server
Returns: (str) Bearer token
Raise: