fix(auth): App Link HTTPS pour le retour OIDC (Chrome bloque le schéma custom)
Build APK / build (push) Successful in 2m29s
Build APK / build (push) Successful in 2m29s
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
3471c82c61
commit
1fe4528b0b
+2
-1
@@ -5,6 +5,7 @@ class Config {
|
|||||||
// OIDC pocket-id (client public + PKCE)
|
// OIDC pocket-id (client public + PKCE)
|
||||||
static const String oidcIssuer = 'https://pocket.nfteam.ovh';
|
static const String oidcIssuer = 'https://pocket.nfteam.ovh';
|
||||||
static const String oidcClientId = '83678fb3-9268-42c1-8dcb-0fb141692a6d';
|
static const String oidcClientId = '83678fb3-9268-42c1-8dcb-0fb141692a6d';
|
||||||
static const String oidcRedirect = 'nfteam.gamemanager://oidc';
|
// App Link HTTPS (fiable ; le schéma custom est bloqué par Chrome au retour)
|
||||||
|
static const String oidcRedirect = 'https://gamemanager-api.nfteam.ovh/oidc/callback';
|
||||||
static const List<String> oidcScopes = ['openid', 'profile', 'email'];
|
static const List<String> oidcScopes = ['openid', 'profile', 'email'];
|
||||||
}
|
}
|
||||||
|
|||||||
+19
-1
@@ -20,15 +20,33 @@ with open("android/key.properties", "w") as f:
|
|||||||
f"storeFile={KEYSTORE_PATH}\n"
|
f"storeFile={KEYSTORE_PATH}\n"
|
||||||
)
|
)
|
||||||
|
|
||||||
# 2) AndroidManifest : permissions
|
# 2) AndroidManifest : permissions + App Link HTTPS (retour OIDC fiable)
|
||||||
man = "android/app/src/main/AndroidManifest.xml"
|
man = "android/app/src/main/AndroidManifest.xml"
|
||||||
s = open(man).read()
|
s = open(man).read()
|
||||||
|
# namespace tools (pour merger dans l'activity de flutter_appauth)
|
||||||
|
if "xmlns:tools" not in s:
|
||||||
|
s = s.replace("<manifest ", '<manifest xmlns:tools="http://schemas.android.com/tools" ', 1)
|
||||||
perms = (
|
perms = (
|
||||||
'<uses-permission android:name="android.permission.INTERNET"/>\n'
|
'<uses-permission android:name="android.permission.INTERNET"/>\n'
|
||||||
' <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES"/>\n'
|
' <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES"/>\n'
|
||||||
)
|
)
|
||||||
if "REQUEST_INSTALL_PACKAGES" not in s:
|
if "REQUEST_INSTALL_PACKAGES" not in s:
|
||||||
s = s.replace("<application", perms + " <application", 1)
|
s = s.replace("<application", perms + " <application", 1)
|
||||||
|
# App Link https://gamemanager-api.nfteam.ovh/oidc/callback → capté par l'app
|
||||||
|
applink = (
|
||||||
|
' <activity android:name="net.openid.appauth.RedirectUriReceiverActivity" '
|
||||||
|
'android:exported="true" tools:node="merge">\n'
|
||||||
|
' <intent-filter android:autoVerify="true">\n'
|
||||||
|
' <action android:name="android.intent.action.VIEW"/>\n'
|
||||||
|
' <category android:name="android.intent.category.DEFAULT"/>\n'
|
||||||
|
' <category android:name="android.intent.category.BROWSABLE"/>\n'
|
||||||
|
' <data android:scheme="https" android:host="gamemanager-api.nfteam.ovh" '
|
||||||
|
'android:path="/oidc/callback"/>\n'
|
||||||
|
' </intent-filter>\n'
|
||||||
|
' </activity>\n'
|
||||||
|
)
|
||||||
|
if "gamemanager-api.nfteam.ovh" not in s:
|
||||||
|
s = s.replace("</application>", applink + " </application>", 1)
|
||||||
open(man, "w").write(s)
|
open(man, "w").write(s)
|
||||||
|
|
||||||
# 3) build.gradle : signature + schéma OIDC
|
# 3) build.gradle : signature + schéma OIDC
|
||||||
|
|||||||
Reference in New Issue
Block a user