Access "before request load event" on Geckofx browser - geckofx

My project has user login restrictions. if the user doesn't have the authorization he can not the use any links in the GeckoFx browser. When the user clicks the link a messagebox will be shown: "You do not have access".
To work around this I need to access the "before request load event". How can this be done?

Related

How to get permanent token for using whatsapp cloud api?

The access token provided by Whatsapp cloud API expires in 24 hours. Is there a way to get a permanent access token?
There is an official link for getting a permanent token on the whatsapp website : Learn how to create a permanent token but it is another rabbit hole which does not state how to get permanent access token.
If someone has done this successfully, please help me and other frustrated developers :)
You need to set up a system user as the admin of your app. You can then generate never expiring access tokens for this system user.
Step by step guide to set it up:
Add a system user to your facebook app if it doesn't exist yet. Make sure it has the admin role.
On the same page, in the "Assigned Assets" section, check whether your app is listed here. If not, add your app via the "Add asset" button, granting "Full control" over your app.
Add the system user to your Whatsapp account in the "People" section, granting "Full control" over your Whatsapp account
Now click the "Generate new token" button for above system user which reveals a "Generate token" popup. Select the 2 permissions whatsapp_business_management and whatsapp_business_messaging and confirm
A new access token is presented to you as a link. Click it and then store the generated token safely as it will not be stored for you by facebook. This token will not expire.
You can get user access token from Facebook oauth using this link: https://www.facebook.com/v8.0/dialog/oauth?client_id=<app_id>&response_type=code%20token&redirect_uri=<redirect_url>&scope=whatsapp_business_management
client_id: App ID of your app on developer.facebook.com
redirect_url: your url where access token will be appended (note: you have to add to "valid oauth redirect urls" of your app "Facebook Login => Settings")
scope: whatsapp_business_management
Once the process is completed the access tokens will be appended to your redirect url.

Google Api Client re-login specific user

In my web app, I'm integrating a "Sign In With Google" button with Google Api Client (JS), in order to then integrate with some other Google services.
So far I've already implemented the login logic: the user is able to click the button and proceed to the application, the flow is this:
the user accepts to connect the app to its google account
then I send the response token to my backend (PHP) to check the token and store in the DB the Google UserID (sud)
If the user had already an account with my app, I update the profile to add the google sign in option.
If the user did not have an account I ask him to register client side.
from now on the user can access my app both with my app's login credentials, and with "Google Sign In".
I send back to the client the access authorization to my app.
My problem is, how to sign in the user automatically the next time? At least two scenarios my happen:
the user opens my app from the computer of a friend in which another google account is already logged in. The user chooses to login in my app with my app's credentials (not "Google Sign In"), so once he/she is logged in, by refreshing the token I would get the wrong Google account. Displaying the authorization window again wouldn't be ideal and would surely offset the user seeing someone else's account.
the user opens my app in incognito (private) mode on a friends' computer, and he/she chooses to login using his/her email and password, not the google sign in. Again, I wouldn't know how to re-sign in the user with the google api client.
Since I know in my backend what Google user is "my user", is there a way to pass such information to the google client api, so that it logs in the right user?

how to turn off oauth consent screen after allow permission?

I have 2 questions in this thread.
I use google API authentication. After run the code to make credential, the browser opens OAuth consent screen in new tab (google chrome). How can I show it as a popup dialog, not open new tab anymore?
After I click accept button, API return the text that tell me token is received in that tab. How can I turn it off immediatelly?
Thank you!
Depends on the language you are using. The consent form is just a web page so assuming you can create your own popup window with a web browser just feed it the consent URI.
You cant really the authentication code is returned to you by the authentication server as a web page its going to have to open up someplace.

How to use OAuth for the Google service

I am coding a MVC 5 internet application in VS2013 Ultimate Update 3
I am referring to the following resource for this question: http://www.asp.net/mvc/tutorials/mvc-5/create-an-aspnet-mvc-5-app-with-facebook-and-google-oauth2-and-openid-sign-on
I have navigated to the Google Developers Console.
I have created a new client ID with the correct Authorized JavaScript and correct Authorized redirect URI
I have entered in the client ID and client secret into the ConfigureAuth() public method in theStartup.Auth file
When clicking on the "Log in using your Google Account" button, I am getting the following error:
401. That’s an error.
Error: invalid_client
no application name
Can I please have some help with this?
This error is because you haven't inserted "PRODUCT NAME" in Consent Screen inside Google Developer Console.
So, log in into Google Developer Console and in Consent Screen,
go to "APIs & auth" > "Consent screen" and enter a "PRODUCT NAME".
Note: Be sure that e-mail address is also provided.

Check User is Logged in or Nor in Web Browser Control

I m trying to make one test app in windows phone 7.1 And I am using webBrowser control in my app and giving url of external website. User input login details in that form and press submit button. How I Can know the user is logged in.
Thanks,
You can track the URL the user is being redirected to, using the WebBrowser.Navigating event. Check the NavigatingEventArgs.Uri property.
Then you just need to work out the page that the login page redirects to, and if the user is navigating to that then they have successfully logged in.

Resources