简体   繁体   English

OAuth 2 登录成功后关闭标签页

[英]OAuth 2 Close Tabs after Success Login

I'm facing problem when using OAuth 2 in my application, after a succefull login and redirection to my App ( browsable app ) i want to force closing tabs that i used in for login ( i'm using browser not webview ).我在我的应用程序中使用 OAuth 2 时遇到问题,在成功登录并重定向到我的应用程序(可浏览应用程序)后,我想强制关闭我用于登录的选项卡(我使用的浏览器不是 webview)。

Any solution that i can do to force closing this tabs?我可以采取任何解决方案来强制关闭此选项卡吗?

It is possible for a mobile app to invoke the external system browser, but not to close it afterwards.移动应用程序可以调用外部系统浏览器,但之后不会关闭它。 There is a preferred solution that usually meets the same goals though.不过,有一个首选解决方案通常可以满足相同的目标。

Use the AppAuth pattern, which works like this:使用 AppAuth 模式,其工作方式如下:

  • The user signs in via an integrated form of the system browser called a Chrome Custom Tab用户通过称为 Chrome 自定义选项卡的系统浏览器的集成形式登录
  • This feels natural from a UX viewpoint, and the app can close this window when login completes从 UX 的角度来看,这感觉很自然,应用程序可以在登录完成时关闭此 window
  • It is also good from a security viewpoint since the app itself never sees the user's password从安全的角度来看,这也很好,因为应用程序本身永远不会看到用户的密码

See this Curity code example for a visual walkthrough.请参阅此 Curity 代码示例以进行可视化演练。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM