NuguOAuthClient
public extension NuguOAuthClient
-
Get some NUGU member information.
ConfigurationStore
must be configured.Declaration
Swift
func getUserInfo(completion: @escaping (Result<NuguUserInfo, NuguLoginKitError>) -> Void)
Parameters
completion
The closure to receive result for getting NUGU member information.
-
Shows web-page where TID information can be modified with
AuthorizationCode
grant type.ConfigurationStore
must be configured.Declaration
Swift
func showTidInfo(parentViewController: UIViewController, completion: @escaping (Result<AuthorizationInfo, NuguLoginKitError>) -> Void)
Parameters
parentViewController
The
parentViewController
will present a safariViewController.completion
The closure to receive result for authorization.
-
Authorize with
AuthorizationCode
grant type.ConfigurationStore
must be configured.Declaration
Swift
func authorizeWithTid(parentViewController: UIViewController, completion: @escaping (Result<AuthorizationInfo, NuguLoginKitError>) -> Void)
Parameters
parentViewController
The
parentViewController
will present a safariViewController.completion
The closure to receive result for authorization.
-
Authorize with
RefreshToken
grant type.ConfigurationStore
must be configured.Declaration
Swift
func refreshToken(refreshToken: String, completion: @escaping (Result<AuthorizationInfo, NuguLoginKitError>) -> Void)
Parameters
refreshToken
The
refreshToken
for OAuth authentication.completion
The closure to receive result for authorization.
-
Authorize with
ClientCredentials
grant type.ConfigurationStore
must be configured.Declaration
Swift
func authorize(completion: @escaping (Result<AuthorizationInfo, NuguLoginKitError>) -> Void)
Parameters
completion
The closure to receive result for authorization.
-
Revoke completly with NUGU
ConfigurationStore
must be configured.Declaration
Swift
func revoke(completion: @escaping (EndedUp<NuguLoginKitError>) -> Void)
Parameters
completion
The closure to receive result for
revoke
.