NuguOAuth

class NuguOAuth(OAuthServerUrl: String?) : NuguOAuthInterface, AuthDelegate, NuguOAuthClient.UrlDelegate

NuguOAuth provides an implementation of the NuguOAuthInterface authorization process.

Constructors

Link copied to clipboard
fun NuguOAuth(OAuthServerUrl: String?)

Types

Link copied to clipboard
object Companion

Companion objects

Functions

Link copied to clipboard
open override fun accountWithTid(    activity: Activity,     listener: NuguOAuthInterface.OnAccountListener,     data: Map<String, String>,     theme: NuguOAuthInterface.THEME)

Start the account info with Tid.

Link copied to clipboard
open override fun addAuthStateListener(listener: AuthStateListener)

addAuthStateListener adds an AuthStateListener on the given was changed

Link copied to clipboard
open override fun authorizationEndpoint(): String
Link copied to clipboard
open override fun baseUrl(): String
Link copied to clipboard
fun clearAuthorization()

Delete a auth token

Link copied to clipboard
fun codeFromIntent(intent: Intent?): String?
Link copied to clipboard
open override fun deviceAuthorizationEndpoint(): String
Link copied to clipboard
fun deviceUniqueId(): String?
Link copied to clipboard
fun getAccountInfoIntent(data: String?): Intent

Creating a accountinfo intent

Link copied to clipboard
fun getAccountInfoUri(data: String?): Uri

Creating a accountinfo uri

Link copied to clipboard
open override fun getAuthorization(): String

Gets an authorization from cache

Link copied to clipboard
fun getAuthState(): AuthStateListener.State

Gets an auth status

Link copied to clipboard
fun getCredentials(): Credentials
Link copied to clipboard
fun getExpiresInMillis(): Long
Link copied to clipboard
fun getIssuedTime(): Long
Link copied to clipboard
fun getLoginIntent(data: String?): Intent

Creating a login intent

Link copied to clipboard
fun getLoginUri(data: String?): Uri

Creating a login uri

Link copied to clipboard
open override fun getOptions(): NuguOAuthOptions?
Link copied to clipboard
fun getRefreshToken(): String
Link copied to clipboard
fun getScope(): String?

Get a scope

Link copied to clipboard
open override fun introspect(listener: NuguOAuthInterface.OnIntrospectResponseListener)

Request introspect The introspect specified by https://tools.ietf.org/html/rfc7662#section-2.1, OAuth 2.0 Token Introspection

Link copied to clipboard
open override fun introspectionEndpoint(): String
Link copied to clipboard
open override fun isAnonymouslyLogin(): Boolean

Check whether a anonymous user is authenticated or not.

Link copied to clipboard
fun isExpired(): Boolean

Check if the token is expired

Link copied to clipboard
open override fun isLogin(): Boolean

Check whether a user is authenticated or not

Link copied to clipboard
fun isSidSupported(): Boolean

Returns true if server-initiative-directive is supported.

Link copied to clipboard
open override fun isTidLogin(): Boolean

Check whether a tid user is authenticated or not

Link copied to clipboard
open override fun loginAnonymously(listener: NuguOAuthInterface.OnLoginListener)

Start anonymous login.

Link copied to clipboard
fun loginInternal(authorizationRequest: AuthorizationRequest, stateListener: AuthStateListener?)

Request an authentication with auth code

Link copied to clipboard
open override fun loginSilentlyWithTid(refreshToken: String, listener: NuguOAuthInterface.OnLoginListener)

Refresh Token with tid.

Link copied to clipboard
open override fun loginWithAuthenticationCode(code: String, listener: NuguOAuthInterface.OnLoginListener)

Start a login without browser.

Link copied to clipboard
open override fun loginWithDeviceCode(deviceCode: String, listener: NuguOAuthInterface.OnLoginListener)

Login with device_code to issue tokens

Link copied to clipboard
open override fun loginWithTid(    activity: Activity,     listener: NuguOAuthInterface.OnLoginListener,     data: Map<String, String>,     theme: NuguOAuthInterface.THEME)

Start the login with tid

Link copied to clipboard
open override fun meEndpoint(): String
Link copied to clipboard
open override fun removeAuthStateListener(listener: AuthStateListener)

Removes an AuthStateListener

Link copied to clipboard
open override fun requestMe(listener: NuguOAuthInterface.OnMeResponseListener)

Request me api

Link copied to clipboard
open override fun revocationEndpoint(): String
Link copied to clipboard
open override fun revoke(listener: NuguOAuthInterface.OnRevokeListener)

Executes revoke the device in a thread.

Link copied to clipboard
fun setAuthorization(tokenType: String, accessToken: String)

Sets a auth token and update to the devicegateway

Link copied to clipboard
fun setAuthState(newState: AuthStateListener.State)

Set the authorization state to be reported onAuthStateChanged to listeners.

Link copied to clipboard
fun setCredentials(credential: Credentials)

fun setCredentials(credential: String)
Link copied to clipboard
open override fun setOptions(options: NuguOAuthOptions)
Link copied to clipboard
fun setResult(result: Boolean)
fun setResult(result: Boolean, error: NuguOAuthError)

Determine success.

Link copied to clipboard
open override fun startDeviceAuthorization(data: String, listener: NuguOAuthInterface.OnDeviceAuthorizationListener)

Start device authorization by requesting a pair of verification codes from the authorization service.

Link copied to clipboard
open override fun tokenEndpoint(): String
Link copied to clipboard
fun verifyStateFromIntent(intent: Intent?): Boolean

Helper function to extract out from the onNewIntent(Intent) for Sign In.