-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support firebase's redirect_url https://xxx.firebaseapp.com/__/auth/handler #40
Comments
Sadly, I don't think it is because how would your application get reopened with the token? It might be possible if you can trigger firebase to get passed the application URL, but without resolving the request... maybe through a push notification? Other than that, I can say it breaks the oauth flow. I doubt we will be able to support that ability. Definitely would consider a PR, though. |
@auser When I was looking at this other day, I found this:
Turns out the firebase handler url call this |
True. I also thought of another method of handling it too using a custom oauth provider. When I'm not driving back from Tahoe, I can detail it a bit more. |
In addition, both platforms have native calls that can receive postMessage messages |
Do you mean it wouldn't be necessary to use the webview component? Can you elaborate? |
Sure. Short typing due to traveling. The oauth methods are handled by native libraries, which handle dealing with the web view (necessary component). We can intercept the postMessage between web view and the native call, so in addition to supporting an all-client side solution, we can intercept the response if generated by a postMesage. |
@auser For a faster solution, can't the android redirect uri be appname://oauth too? If not, why? Android supports it as well. |
What about if you have an app and a website that use the same firebase DB/GitHub signup? The proposed solution of having appname://oauth won't work because the website requires that the OAuth method calls back to firebaseapp.com/__/auth/handler I considered putting a middleman service in between, as GitHub allows different redirects providing they are on the same domain, e.g. http://beaney.com/index.php Where index.php redirects to firebaseapp.com/__/auth/handler and index2.php would call back to appname://oauth. But I can't get the website one working. No idea what to pass into it as this is obscured from view. Any ideas? |
@beaneyDev I'm using this https://github.com/brunolemos/micro-oauth You can pass the callback URL like this: |
Okay I think I have a solution. The implementation is hacky as hell but I think it could be refined a little:
So that's how I'm handling the website. Then app side - I do something similar but specify https://oauth-forwarder.herokuapp.com/redir_mobile.php, which redirects to mb://?code={CODE}. GitHub sucks. |
So, I have an Android & iOS app:
http://appname://oauth
http://localhost/github
If two
redirect_uri
are required, I have to to create two oauth applications on GitHub.Firebase project console only supports 1 clientId and 1 clientId per provider.
How to have a
iOS
&Android
application with only1 firebase project
and1 oauth application
?I believe a single
redirect_url
is the answer.Firebase provides the
https://xxx.firebaseapp.com/__/auth/handler
.Is that possible?
The text was updated successfully, but these errors were encountered: