I am using a SAML link for authentication.
and here is my code implementation:
class LoginWebView extends StatefulWidget {
const LoginWebView({super.key});
@override
State<LoginWebView> createState() => _LoginWebViewState();
}
class _LoginWebViewState extends State<LoginWebView> {
final tokenManager = TokenManager();
InAppWebViewController? inAppWebViewController;
bool isShowingError = false;
late var url;
var initialUrl =
"https://accounts.google.com/o/saml2/initsso?idpid=C02qtgmcd&spid=858410514048&forceauthn=false";
//late WebViewController controller;
String? token;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text("Login"),
),
body: Column(
children: [
Expanded(
child: InAppWebView(
initialUrlRequest: URLRequest(url: Uri.parse(initialUrl)),
onWebViewCreated: (controller) async {
inAppWebViewController = controller;
},
onProgressChanged: onWebViewProgressChanged,
),
),
],
),
);
}
}
But I am unable to logout the user.
Can anyone please tell me how to logout from SAML based authentication?
You need to follow some steps to logout user
here is sample code.