Skip to content

Instantly share code, notes, and snippets.

@tdcolvin
Last active May 8, 2025 14:25
Show Gist options
  • Select an option

  • Save tdcolvin/7ddf6052262b7aff919ad9ef6f2f1f1f to your computer and use it in GitHub Desktop.

Select an option

Save tdcolvin/7ddf6052262b7aff919ad9ef6f2f1f1f to your computer and use it in GitHub Desktop.
// Get the registration options from the auth server
suspend fun getPasskeyRegisterRequestJson(username: String): String
= withContext(Dispatchers.IO) {
val url = HttpUrl.Builder()
.scheme("https")
.host("auth.tomcolvin.co.uk")
.addPathSegment("generate-registration-options")
.addQueryParameter("username", username)
.build()
val request = Request.Builder()
.url(url)
.build()
val response = okHttpClient.newCall(request).execute()
response.body?.string() ?: throw Exception("No response body")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment