Skip to content

Instantly share code, notes, and snippets.

@seit
Created December 15, 2022 10:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seit/14f2f1c0ea30c6031a3b12c17b9bfd4d to your computer and use it in GitHub Desktop.
Save seit/14f2f1c0ea30c6031a3b12c17b9bfd4d to your computer and use it in GitHub Desktop.
val activityResult = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result: ActivityResult ->
// 認可決定まで完了し、ネイティブアプリにリダイレクトされる。
// Authorization Codeが返されるので、トークンエンドポイントにリクエスト
val resp = AuthorizationResponse.fromIntent(result.data!!)
val ex = AuthorizationException.fromIntent(result.data)
_authState!!.update(resp, ex)
_authService!!.performTokenRequest(
resp!!.createTokenExchangeRequest(),
tokenResponseCallback)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment