Skip to content
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

Facebook OAuth Package #1

Open
mohammadkhair7 opened this issue Apr 18, 2021 · 9 comments
Open

Facebook OAuth Package #1

mohammadkhair7 opened this issue Apr 18, 2021 · 9 comments

Comments

@mohammadkhair7
Copy link

Hello,

Awesome package, and very enabling toolset.

Do you happen to have a Facebook OAuth related feature for this package ?
If not, can you post an update with it ?

Thanks.

@francois-normandin
Copy link
Member

Hi @mohammadkhair7 ,

unfortunately, I don't have a Facebook account, so I can't test an Oauth2 request workflow on Facebook.
The extension should not be very difficult to implement, but one needs to have an account to be able to test the workflow.
From what I can tell from online doc, it is pretty a standard, so I've made a branch with the code as I think it should be.
If you'd be willing to test it and report back, I'm sure others would appreciate too ;-)

https://github.com/LabVIEW-Open-Source/Oauth2/tree/feature/facebook

I've listed the "public_profile" scope as default, but it can be extended with your own needs using the initialize method.

image

image

@mohammadkhair7
Copy link
Author

mohammadkhair7 commented Apr 18, 2021 via email

@francois-normandin
Copy link
Member

You can change the redirect URI two ways...

  1. Either you override it in the Facebook class, if Facebook actually imposes restrictions on the redirection... (some providers do not support localhost, for example). But this is best left alone unless you make a Oauth2 class specifically for your own project...

  2. Or you can use the property nodes to specify your own URI. (preferred way)

Method 1:
image
Here's the code you would be overwriting:
image

Method 2:
Change it directly from the property nodes:
image

Make sure you've set the redirection address accordingly in your Facebook developer's console...

@francois-normandin
Copy link
Member

But you shouldn't need any web services to capture the redirection.
Look into the Authorize method:

image

@francois-normandin
Copy link
Member

francois-normandin commented Apr 18, 2021

ok, you will need to specify the redirection URL in your developer's zone:

"message": "Can't Load URL: The domain of this URL isn't
included in the app's domains. To be able to load this URL, add all
domains and subdomains of your app to the App Domains field in your
app settings.",

This error message suggests that "localhost" is not allowed as it is configured in your developer's console...

I don't know how it's done in facebook's developer console, but here is what this looks like in Github:
image

@mohammadkhair7
Copy link
Author

mohammadkhair7 commented Apr 18, 2021 via email

@francois-normandin
Copy link
Member

Indeed. It cannot be easily done in LV2013, but LV2020 introduced TLS support for HTTP client, so I'll see you expose a dependent injectable override to allow for extending with https.
I'm not promising when I'll have time to look into it, but feel free to modify the code in a fork of you want to give it a try...

@mohammadkhair7
Copy link
Author

Yes in Labview 2020, you can configure the HTTP request to become HTTPS as in the picture with ConfigSSL vi, however, you need to have the certificates it seems to make that happen. I will have to find out where to get these certificates from. If you can think of a work around that my application can use to enable login into Facebook let me know. Otherwise, thank you very very much for your support, you did an amazing job! By the way I am also a Biomedical Engineer!

image

@francois-normandin
Copy link
Member

francois-normandin commented Apr 19, 2021

You might want to install self-signed certificates.
Take a look at this tutorial
https://youtu.be/2-OJ-U6eTmE

The video features functionality I developed for another project, but which might be useful in this case. The package can be installed with vipm community.
https://github.com/LabVIEW-Open-Source/LabVIEW-Certification-Authority/wiki/Creation-of-Self-Signed-Certificates-for-TLS-authentication

Good luck!

(https://www.vipm.io/package/labview_open_source_project_lib_certification_authority/)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants