flutter - 如何使用flutter_appauth注销?
问题描述
我需要在flutter中按下按钮从flutter_appauth注销;
这个包没有任何注销方法。
这是我的获取令牌代码:
appAuth.authorizeAndExchangeCode(AuthorizationTokenRequest(
clientID, redirectUrl,
discoveryUrl: discoveryUrl,
scopes: scopes,
clientSecret: clientSecret
解决方案
在那个包中,没有任何解决方案,但这个问题有两种解决方法:
这是您的浏览器,因此您可以清除浏览器的缓存:)
当您调用授权和交换代码的方法时,需要添加一个名为“promptValues”的附加参数和“登录”值。这样,每次登录时,缓存中都没有值,它总是要求新的登录。
做这个 :
final AuthorizationTokenResponse result =
await appAuth.authorizeAndExchangeCode(
AuthorizationTokenRequest(
your_client_id,
your_localhost,
promptValues: ['login'],
discoveryUrl:
your_discovery_url,
scopes: [your_scopes],
),
);
推荐阅读
- asp.net-mvc - kendo.saveAs“下载excel”不在服务器上工作,但在本地机器上工作
- java - 如何自动右键单击jtable并选择第一个JMenu项目
- ubuntu - 此工具不支持从“宇宙”升级到“焦点”
- python - 如何理解“-input[range(target.shape[0]), target]”?
- rx-java - Vertx RxJava Operator 迭代不过滤内容
- javascript - .get 不是函数:当我获取 js 控制器的输入值时,我遇到了错误
- javascript - JSHint 警告:在引用外部范围变量的循环中声明的函数可能会导致语义混淆。(文件,读者)
- android - 如何在 ionic 5 中播放内部存储器中的视频?
- javascript - 不允许函数在执行后的一段时间内执行
- react-native - React 本机纸质复选框设计不起作用,不可见,涟漪效应有效