Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

Firebase sample not working

 Post Reply Post Reply
Author
Miertschink Andre View Drop Down
New Member
New Member
Avatar

Joined: 02 Dec 2017
Posts: 2
Post Options Post Options   Quote Miertschink Andre Quote  Post ReplyReply Direct Link To This Post Topic: Firebase sample not working
    Posted: 02 Dec 2017 at 11:02pm
Hi,
The Firebase example is not working. I added keys properly, however when connecting I only see the program opening a browser (probably for authentication) but is not loaded. Besides that, is not possible to authenticate without opening the browser? This is definitely not elegant and professional for me to implement this in a program.
Thx
Back to Top
Bruno Fierens View Drop Down
TMS Support
TMS Support
Avatar

Joined: 11 May 2010
Posts: 8756
Post Options Post Options   Quote Bruno Fierens Quote  Post ReplyReply Direct Link To This Post Posted: 03 Dec 2017 at 10:15am
1) Please set AdvFireBaseObjectDatabase.ExternalBrowser = true. This is a new requirement from Google.

2) At least a one-time authentication & authorization is needed.  This is a fundamental security principle of OAUTH2 After this one-time authentication & authorization and access & refresh token is obtained, can be persisted and can be reused without further authentication.
Back to Top
Miertschink Andre View Drop Down
New Member
New Member
Avatar

Joined: 02 Dec 2017
Posts: 2
Post Options Post Options   Quote Miertschink Andre Quote  Post ReplyReply Direct Link To This Post Posted: 03 Dec 2017 at 11:04am
Thx Bruno for prompt response. I will try it soon.
However, as mentioned before, it would be much nicer to avoid requiring the use to login using browser.

Maybe you had a look already at Grijjy's blog post and could implement a way to use their TgoGoogleSDK class (according to site works not only Android, but works also with Windows and iOS ; not sure about macOS).
https://blog.grijjy.com/2017/07/20/using-google-sign-in-for-firebase-sdk-on-android/



Back to Top
Bruno Fierens View Drop Down
TMS Support
TMS Support
Avatar

Joined: 11 May 2010
Posts: 8756
Post Options Post Options   Quote Bruno Fierens Quote  Post ReplyReply Direct Link To This Post Posted: 03 Dec 2017 at 7:47pm
In our TMS VCL & FMX Cloud Pack, all access to cloud services is based on the OAUTH 2 implementation and all components build upon this common layer to do OAUTH2 based access control. This is a standard: https://oauth.net/2/ and is consistent on every platform.
Back to Top
Automação.com View Drop Down
New Member
New Member
Avatar

Joined: 30 Nov 2017
Posts: 22
Post Options Post Options   Quote Automação.com Quote  Post ReplyReply Direct Link To This Post Posted: 01 Mar 2018 at 2:01pm
Hello,
would you know help me how exactly do I get this information:

//  FAppKey = 'xxxxxxxxx';
//  FAppSecret = 'xxxxxxxxx';
//  FAppDatabase = 'xxxxxxxxx';

Back to Top
Bart Holvoet View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 2219
Post Options Post Options   Quote Bart Holvoet Quote  Post ReplyReply Direct Link To This Post Posted: 01 Mar 2018 at 2:07pm
Hi,

Instructions to retrieve authentication credentials are available here:
Back to Top
Automação.com View Drop Down
New Member
New Member
Avatar

Joined: 30 Nov 2017
Posts: 22
Post Options Post Options   Quote Automação.com Quote  Post ReplyReply Direct Link To This Post Posted: 01 Mar 2018 at 2:39pm
Unfortunately your information of nothing helped.
I had already found this information.
What I would really like (if it was not too much) is exactly where I can extract all the keys previously reported.
Back to Top
Bart Holvoet View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 2219
Post Options Post Options   Quote Bart Holvoet Quote  Post ReplyReply Direct Link To This Post Posted: 01 Mar 2018 at 2:49pm
The FAppDatabase value should be set to the database name as displayed in the link from my previous message.

The instructions to generate a client id and secret which should be assigned to the FAppKey and FAppSecret respectively are found on the same page:
Back to Top
Automação.com View Drop Down
New Member
New Member
Avatar

Joined: 30 Nov 2017
Posts: 22
Post Options Post Options   Quote Automação.com Quote  Post ReplyReply Direct Link To This Post Posted: 01 Mar 2018 at 3:33pm

After all the correct settings, it presents the problem below:
400.
 That?s an error.

Error: redirect_uri_mismatch

The redirect URI in the request, http://127.0.0.1:8889/, does not match the ones authorized for the OAuth client. To update the authorized redirect URIs, visit: https://console.developers.google.com/apis/credentials/oauthclient/169002746094-34hqb5f78ukgs0j1gln65p3okpfcuboj.apps.googleusercontent.com?project=169002746094

Learn more

Back to Top
Automação.com View Drop Down
New Member
New Member
Avatar

Joined: 30 Nov 2017
Posts: 22
Post Options Post Options   Quote Automação.com Quote  Post ReplyReply Direct Link To This Post Posted: 01 Mar 2018 at 4:47pm
For knowledge:

The TMS components can only access if the google credential is informed of the type of application = other.
In the manual informs: application type = web application, but it does not work.
Back to Top
Bart Holvoet View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 2219
Post Options Post Options   Quote Bart Holvoet Quote  Post ReplyReply Direct Link To This Post Posted: 01 Mar 2018 at 4:59pm
Originally posted by Automação.com

After all the correct settings, it presents the problem below:
400.
 That?s an error.

Error: redirect_uri_mismatch

The redirect URI in the request, http://127.0.0.1:8889/, does not match the ones authorized for the OAuth client. To update the authorized redirect URIs, visit: https://console.developers.google.com/apis/credentials/oauthclient/169002746094-34hqb5f78ukgs0j1gln65p3okpfcuboj.apps.googleusercontent.com?project=169002746094

Learn more


Please make sure that the redirect URI defined in the Google Console is identical to the value of the App.CallbackURL property of your cloud component in Delphi.
Back to Top
Bart Holvoet View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 2219
Post Options Post Options   Quote Bart Holvoet Quote  Post ReplyReply Direct Link To This Post Posted: 01 Mar 2018 at 4:59pm
Originally posted by Automação.com

For knowledge:

The TMS components can only access if the google credential is informed of the type of application = other.
In the manual informs: application type = web application, but it does not work.

We are not aware of such an issue with the Google related components in TMS VCL Cloud Pack.
Do you see any error messages?
Back to Top
Automação.com View Drop Down
New Member
New Member
Avatar

Joined: 30 Nov 2017
Posts: 22
Post Options Post Options   Quote Automação.com Quote  Post ReplyReply Direct Link To This Post Posted: 01 Mar 2018 at 6:04pm
The error message is what was displayed in the previous message.
Back to Top
Automação.com View Drop Down
New Member
New Member
Avatar

Joined: 30 Nov 2017
Posts: 22
Post Options Post Options   Quote Automação.com Quote  Post ReplyReply Direct Link To This Post Posted: 01 Mar 2018 at 6:05pm
I configured exactly as it was informed in component = google.
I can send the prints if you want.
Back to Top
Bruno Fierens View Drop Down
TMS Support
TMS Support
Avatar

Joined: 11 May 2010
Posts: 8756
Post Options Post Options   Quote Bruno Fierens Quote  Post ReplyReply Direct Link To This Post Posted: 01 Mar 2018 at 6:29pm
If the error says:

The redirect URI in the request, http://127.0.0.1:8889/, does not match the ones authorized for the OAuth client. 

That means that your callback URL configured in the Google dev console does not match the one you use in your application. The URL should be *EXACTLY* the same, including backslash etc ...  This is not an issue in our component, this is an issue in your config of the Google API.
Back to Top
Suratemeekul Chaiyaporn View Drop Down
New Member
New Member
Avatar

Joined: 22 Jul 2011
Posts: 2
Post Options Post Options   Quote Suratemeekul Chaiyaporn Quote  Post ReplyReply Direct Link To This Post Posted: 02 Apr 2018 at 1:27pm
Hi,

I've same problem but after view html error source , it redirect to http://127.0.0.1:8888
and after change to http://127.0.0.1:8888/ , I can login
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down