Code Monkey home page Code Monkey logo

Comments (6)

iainmcgin avatar iainmcgin commented on May 22, 2024

This isn't implemented in the library at present as we don't have a convenient place to monitor events from the opened custom tab. The situation is also more complex when using an intent for the system browser, as there is no such event to capture. I had planned to return to this and devise a solution to handle this (as it exists in the iOS variant of the library) but haven't had time yet. I'd be happy to discuss solutions and accept contributions to solve this problem.

from appauth-android.

mattinger avatar mattinger commented on May 22, 2024

I did look at the code, and noticed the "startActivity" call in AuthorizationService. I'm wondering if we instead call startActivityForResult, if both the chrome custom tab and the system browser would send a result back. It's unclear to me, however, what that result would look like in terms of hitting the close button as opposed to the window closing on a redirect. I suppose that would really be browser dependent.

from appauth-android.

iainmcgin avatar iainmcgin commented on May 22, 2024

Unfortunately I don't believe custom tabs return results in this way, and the defined callbacks don't appear to indicate when a tab is dismissed. I think the only option is to store some information in the invoking activity such that when a onStart / onResume occurs, we could determine whether an authorization flow was in progress. Returning to the original activity would likely mean the tab was closed, and we could take some remedial action at that point. I'm not sure if that kind of behavior belongs in the library or not; I'll need to experiment.

from appauth-android.

mattinger avatar mattinger commented on May 22, 2024

I figured that might be the case. We're working with our oauth team to implement a custom prompt=reauth flow so that we can use a webview and pass a login_id_hint or something to it, and not have to shared the cookies with the chrome browser itself. This can be closed if you feel it's not realistically implementable.

from appauth-android.

iainmcgin avatar iainmcgin commented on May 22, 2024

I'll leave it open until I mull over the problem some more; I'll also talk to the Chrome team as providing some kind of callback for closing the tab seems legitimately useful.

from appauth-android.

iainmcgin avatar iainmcgin commented on May 22, 2024

This is now fixed by #109 - we can fire a different intent for the user canceling the authorization flow.

from appauth-android.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.