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
-
OAuthResultType
-
OAuthSigningMethod
Name | Value | Since | Description | See Also |
---|---|---|---|---|
OAUTH_RESULT_TYPE_URL | 0 | API Level 3.3.0 |
How the OAuth token will be returned in the final step. |
Name | Value | Since | Description | See Also |
---|---|---|---|---|
OAUTH_SIGNING_METHOD_HMAC_SHA1 | 0 | API Level 3.3.0 |
How the OAuth request will be signed |
Instance Method Summary collapse
-
makeOAuthRequest(requestUrl as Lang.String, requestParams as Lang.Dictionary<Lang.String, Lang.String>, resultUrl as Lang.String, resultType as Authentication.OAuthResultType, resultKeys as Lang.Dictionary<Lang.String, Lang.String>) as Void
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 as Lang.Method(message as Authentication.OAuthMessage) as Void) as Void
Register a callback for receiving OAuth messages.
Instance Method Details
makeOAuthRequest(requestUrl as Lang.String, requestParams as Lang.Dictionary<Lang.String, Lang.String>, resultUrl as Lang.String, resultType as Authentication.OAuthResultType, resultKeys as Lang.Dictionary<Lang.String, Lang.String>) as Void
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 as Lang.Method(message as Authentication.OAuthMessage) as Void) as Void
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.