Skip to content

Instantly share code, notes, and snippets.

@Alqueraf
Last active September 3, 2020 18:33
Show Gist options
  • Save Alqueraf/c1d32e03e4f019ca08e71fc508adc423 to your computer and use it in GitHub Desktop.
Save Alqueraf/c1d32e03e4f019ca08e71fc508adc423 to your computer and use it in GitHub Desktop.
OAuth Redirect Listener
private val uniqueState = UUID.randomUUID().toString()
// Prepare URL
val uri = Uri.parse(authorizationUrl)
.buildUpon()
.appendQueryParameter("client_id", clientID)
.appendQueryParameter("redirect_uri", redirectUri)
.appendQueryParameter("response_type", "code")
.appendQueryParameter("scope", scopes.joinToString(separator = " "))
.appendQueryParameter("state", uniqueState)
.build()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment