OAuth2App

Extends

  • Homey.App

Properties

OAUTH2_CLIENT

OAUTH2_CLIENT: OAuth2Client

OAUTH2_DEBUG

OAUTH2_DEBUG: boolean

Type

  • boolean

OAUTH2_DRIVERS

OAUTH2_DRIVERS: Array.<string>

We assume all drivers use OAuth2. In some cases, some drivers may never become ready. Make sure to exclude those drivers from this array.

Type

  • Array.<string>

OAUTH2_MULTI_SESSION

OAUTH2_MULTI_SESSION: boolean

Type

  • boolean

Methods

checkHasConfig

checkHasConfig(args)

Parameters

Name Type Description
args
object
configId
string
}

checkHasOAuth2Client

checkHasOAuth2Client(args)

Parameters

Name Type Description
args
object
sessionId
string
configId
string
}

createOAuth2Client

createOAuth2Client(args): *

Parameters

Name Type Description
args
object
sessionId
string
configId
string
}

Returns

*

deleteOAuth2Client

deleteOAuth2Client(args)

Parameters

Name Type Description
args
object
sessionId
string
configId
string
}

disableOAuth2Debug

disableOAuth2Debug()

enableOAuth2Debug

enableOAuth2Debug()

getConfig

getConfig(args): *

Parameters

Name Type Description
args
object
configId
string
}

Returns

*

getFirstSavedOAuth2Client

getFirstSavedOAuth2Client(): OAuth2Client

Returns

getOAuth2Client

getOAuth2Client(args): OAuth2Client

Parameters

Name Type Description
args
object
sessionId
string
configId
string
}

Returns

getOAuth2Devices

(async) getOAuth2Devices(args): Promise.<array>

Parameters

Name Type Description
args
object
sessionId
string
configId
string
}

Returns

Promise.<array>

getSavedOAuth2Sessions

getSavedOAuth2Sessions(): object

Returns

object

onInit

(async) onInit(): Promise.<void>

Returns

Promise.<void>

onOAuth2Init

(async) onOAuth2Init(): Promise.<void>

Returns

Promise.<void>

onOAuth2Uninit

(async) onOAuth2Uninit(): Promise.<void>

Returns

Promise.<void>

onShouldDeleteSession

(async) onShouldDeleteSession(args): Promise.<boolean>

Parameters

Name Type Description
args
object
sessionId
string
configId
string
}

Returns

Promise.<boolean>

onUninit

(async) onUninit(): Promise.<void>

Returns

Promise.<void>

saveOAuth2Client

saveOAuth2Client(args)

Parameters

Name Type Description
args
object
configId
string
sessionId
string
client
OAuth2Client
}

setOAuth2Config

setOAuth2Config(args)

Set the app's config. Most apps will only use one config, default. All methods default to this config. For apps using multiple clients, a configId can be provided.

Parameters

Name Type Description
args
object
configId
string
client
OAuth2Client
clientId
string
clientSecret
string
apiUrl
string
token
string
tokenUrl
string
authorizationUrl
string
redirectUrl
string
scopes
Array.<string>
allowMultiSession
boolean
}

tryCleanSession

tryCleanSession(args)

Parameters

Name Type Description
args
object
sessionId
string
configId
string
}