mirror of
https://github.com/kalarina-bit/Sparkledns.git
synced 2026-11-22 07:36:09 +00:00
Receive the sign-in callback on skysparkle.cc
The site now returns through an intent:// link that names this package, so no separate subdomain or domain verification is needed and no other app can receive the one-time code.
This commit is contained in:
@@ -38,15 +38,15 @@
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
<!-- End of the Skysparkle sign-in: the site sends the browser back with a one-time code.
|
||||
A verified App Link (app.skysparkle.cc/.well-known/assetlinks.json names this app's
|
||||
signing key), so no other app can catch the code. A separate subdomain, because
|
||||
Chrome keeps links to the site you are already on inside the browser -->
|
||||
<intent-filter android:autoVerify="true">
|
||||
<!-- End of the Skysparkle sign-in: the site sends the browser back with a one-time code
|
||||
through an intent:// link that names this package, so Android hands it only to this
|
||||
app. No autoVerify: a link with a package needs no domain verification, and plain
|
||||
visits to skysparkle.cc stay in the browser -->
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
<data android:scheme="https" android:host="app.skysparkle.cc" android:path="/app/callback" />
|
||||
<data android:scheme="https" android:host="skysparkle.cc" android:path="/app/callback" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
|
||||
@@ -25,14 +25,14 @@ import java.security.SecureRandom
|
||||
// Sign-in with a Skysparkle account: the app gets its access key without copying it by hand.
|
||||
//
|
||||
// OAuth for native apps (RFC 8252) with PKCE (RFC 7636): the account page opens in the browser,
|
||||
// so the password never passes through the app. After "Connect" the site sends the browser to
|
||||
// https://app.skysparkle.cc/app/callback?code=…&state=…, a verified App Link that only this app
|
||||
// (signed with our key) receives, and the app trades the one-time code for a new key. Only this
|
||||
// app knows the verifier, so even a code that leaked somewhere else is useless.
|
||||
// so the password never passes through the app. After "Connect" the site opens
|
||||
// https://skysparkle.cc/app/callback?code=…&state=… through an intent:// link that names this
|
||||
// package, so Android delivers it only to this app, and the app trades the one-time code for a
|
||||
// new key. Only this app knows the verifier, so even a code that leaked somewhere is useless.
|
||||
object SkysparkleSignIn {
|
||||
private const val CONNECT_URL = "https://skysparkle.cc/app/connect"
|
||||
private const val TOKEN_URL = "https://skysparkle.cc/api/app/token"
|
||||
private const val CALLBACK_HOST = "app.skysparkle.cc"
|
||||
private const val CALLBACK_HOST = "skysparkle.cc"
|
||||
private const val CALLBACK_PATH = "/app/callback"
|
||||
|
||||
// The browser step must be finished within this time (the site keeps codes for 5 minutes)
|
||||
|
||||
Reference in New Issue
Block a user