Fixes the Android Login process
This commit is contained in:
parent
dd5904f0a7
commit
75b298b0f8
16 changed files with 106 additions and 129 deletions
|
|
@ -0,0 +1,35 @@
|
|||
using Android.App;
|
||||
using Android.Content;
|
||||
using Android.Content.PM;
|
||||
using Android.OS;
|
||||
using PostIt.Droid.Services;
|
||||
|
||||
namespace PostIt.Android;
|
||||
|
||||
[Activity(NoHistory = true, LaunchMode = LaunchMode.SingleTop, Exported = true)]
|
||||
[IntentFilter(new[] { Intent.ActionView },
|
||||
Categories = new[] { Intent.CategoryDefault, Intent.CategoryBrowsable },
|
||||
DataScheme = "postit", // Remplacez par votre schéma personnalisé (ex: yavsc ou postit)
|
||||
DataHost = "callback")] // Correspond à postit://callback
|
||||
public class WebAuthenticationCallbackActivity : Activity
|
||||
{
|
||||
protected override void OnCreate(Bundle? savedInstanceState)
|
||||
{
|
||||
base.OnCreate(savedInstanceState);
|
||||
|
||||
// Capturer l'URL de redirection OIDC
|
||||
var url = Intent?.DataString;
|
||||
|
||||
if (!string.IsNullOrEmpty(url))
|
||||
{
|
||||
// Transmettre l'URL au gestionnaire partagé pour compléter la Task
|
||||
OidcCallbackManager.SetResult(url);
|
||||
}
|
||||
|
||||
// Fermer cette activité transparente et ramener l'application au premier plan
|
||||
var intent = new Intent(this, typeof(MainActivity));
|
||||
intent.AddFlags(ActivityFlags.ClearTop | ActivityFlags.SingleTop);
|
||||
StartActivity(intent);
|
||||
Finish();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue