Module: Toybox.Authentication
Overview
The Authentication Module provides tools for authentication.
With the Authentication module, Connect IQ apps will be able to make OAuth requests redirected through Connect IQ mobile app.
Classes Under Namespace
Classes: Message, OAuthMessage
Constant Summary
Enumerator
Name | Value | Since | Description |
---|---|---|---|
OAUTH_RESULT_TYPE_URL | 0 | API Level 3.3.0 |
How the OAuth token will be returned in the final step. |
Enumerator
Name | Value | Since | Description |
---|---|---|---|
OAUTH_SIGNING_METHOD_HMAC_SHA1 | 0 | API Level 3.3.0 |
How the OAuth request will be signed |
Instance Method Summary collapse
-
makeOAuthRequest(requestUrl, requestParams, resultUrl, resultType, resultKeys)
Request an OAuth sign-in through Garmin Connect IQ Mobile App A notification will trigger on the phone, that when clicked, provides a web view that shows
requestUrl
. -
registerForOAuthMessages(method)
Register a callback for receiving OAuth messages.
Instance Method Details
makeOAuthRequest(requestUrl, requestParams, resultUrl, resultType, resultKeys)
Request an OAuth sign-in through Garmin Connect IQ Mobile App
A notification will trigger on the phone, that when clicked, provides a
web view that shows requestUrl
. If the user grants permission to the app,
then the callback registered by
registerForOAuthMessages()
will be called with an OAuthMessage
from the OAuth response.
registerForOAuthMessages(method)
Register a callback for receiving OAuth messages.
The callback will be called once for each received OAuth message. If there are messages waiting for the app when this function is called, the callback will immediately be called once for each waiting message.