Skip to content

Instantly share code, notes, and snippets.

@tdcolvin
Created May 9, 2025 23:15
Show Gist options
  • Select an option

  • Save tdcolvin/5fbeeccc92572f5bb5935cc2a524d03b to your computer and use it in GitHub Desktop.

Select an option

Save tdcolvin/5fbeeccc92572f5bb5935cc2a524d03b to your computer and use it in GitHub Desktop.
suspend fun getPasskeyAuthenticationRequestJson(username: String): String = withContext(
Dispatchers.IO) {
val url = HttpUrl.Builder()
.scheme("https")
.host("auth.tomcolvin.co.uk")
.addPathSegment("generate-authentication-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