Authorization for Facebook

35 views
Skip to first unread message

Anders Persson

unread,
Feb 6, 2014, 6:31:51 AM2/6/14
to eiffel-web...@googlegroups.com
Hi

I copied another example in the Oath library when starting the Fecbook example. THis is one part of it:

if attached access_token as l_access_token then
print ("%NGot the Access Token!%N");
print ("%N(Token: " + l_access_token.debug_output + " )%N");

--Now let's go and ask for a protected resource!
print ("%NNow we're going to access a protected resource...%N");
create request.make ("GET", protected_resource_url)
request.add_header ("Authorization", "Bearer " + l_access_token.token)
api_service.sign_request (l_access_token, request)
if attached {OAUTH_RESPONSE} request.execute as l_response then
print ("%NOk, let see what we found...")
print ("%NResponse: STATUS" + l_response.status.out)
if attached l_response.body as l_body then
print ("%NBody:" + l_body)
end
end
end


THis row:

request.add_header ("Authorization", "Bearer " + l_access_token.token)


What does it do?

Is it necessary? I do not want to keep it if not necessary for this example.


Furthermore, the example works but I only get "true" in the body.

I have set 

protected_resource_url : STRING = "https://graph.facebook.com/me"

When writing the same https-string with token etc I get a JSON answer with all my personal information. I this due to that it is a OAUTH_QUESTION and then it only checks if I am allowed to access the information, .e.g I get the answer "true"


Regards

ANders

JV

unread,
Feb 6, 2014, 7:27:30 AM2/6/14
to eiffel-web...@googlegroups.com
Hi


On Thursday, February 6, 2014 8:31:51 AM UTC-3, Anders Persson wrote:
Hi

I copied another example in the Oath library when starting the Fecbook example. THis is one part of it:

if attached access_token as l_access_token then
print ("%NGot the Access Token!%N");
print ("%N(Token: " + l_access_token.debug_output + " )%N");

--Now let's go and ask for a protected resource!
print ("%NNow we're going to access a protected resource...%N");
create request.make ("GET", protected_resource_url)
request.add_header ("Authorization", "Bearer " + l_access_token.token)
api_service.sign_request (l_access_token, request)
if attached {OAUTH_RESPONSE} request.execute as l_response then
print ("%NOk, let see what we found...")
print ("%NResponse: STATUS" + l_response.status.out)
if attached l_response.body as l_body then
print ("%NBody:" + l_body)
end
end
end


THis row:

request.add_header ("Authorization", "Bearer " + l_access_token.token)


What does it do?

Is it necessary? I do not want to keep it if not necessary for this example.
Yes it's necessary, Bearer tokens are required by the specification of OAuth2.0 (http://tools.ietf.org/html/rfc6750) to access protected resources.

/Javier

Anders Persson

unread,
Feb 6, 2014, 10:16:59 AM2/6/14
to eiffel-web...@googlegroups.com
Thanks

I am still struggeling with understanding why I get different information using Oath and pasting the same string in a browser for example:


I can see in the Eiffel System debugger that the https look ok. I copy and paste it from the debugger to the browser. In my Eiffel-code I only get a body with the content "true" but from the browser I get a json. What does the browser do more compared to what this call do?

if attached {OAUTH_RESPONSE} request.execute as l_response then

regards

Anders

javier hector

unread,
Feb 6, 2014, 10:44:37 AM2/6/14
to eiffel-web...@googlegroups.com
I will take a look later and let you know.


--
--
You received this message because you are subscribed to the Google
Groups "Eiffel Web Framework" group.
 
To post to this group, send email to
eiffel-web...@googlegroups.com
To unsubscribe from this group, send email to
eiffel-web-frame...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/eiffel-web-framework
 
See the site for the Eiffel-Web-Framework project at
https://github.com/EiffelWebFramework/EWF
---
You received this message because you are subscribed to the Google Groups "Eiffel Web Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eiffel-web-frame...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

JV

unread,
Feb 6, 2014, 4:04:11 PM2/6/14
to eiffel-web...@googlegroups.com
Hi Anders,

I have added a simple example and it's working fine.

You can check the code here, there is also a pull request, but I prefer to wait and see if it's working for you, before to merge the changes.

Double check the callback URL, it should be the same as in the Facebook app creation page.


By the way I also found an issue, when the scope was not present, so I fixed it, but I we need to double check it's the best solution.

/Javier



To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/eiffel-web-framework
 
See the site for the Eiffel-Web-Framework project at
https://github.com/EiffelWebFramework/EWF
---
You received this message because you are subscribed to the Google Groups "Eiffel Web Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eiffel-web-framework+unsub...@googlegroups.com.

Anders Persson

unread,
Feb 6, 2014, 4:43:02 PM2/6/14
to eiffel-web...@googlegroups.com
Hi

I will look into it tomorrow.

Regards

Anders


2014-02-06 JV <javier...@gmail.com>:

To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/eiffel-web-framework
 
See the site for the Eiffel-Web-Framework project at
https://github.com/EiffelWebFramework/EWF
---
You received this message because you are subscribed to the Google Groups "Eiffel Web Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eiffel-web-frame...@googlegroups.com.

Anders Persson

unread,
Feb 7, 2014, 3:48:15 AM2/7/14
to eiffel-web...@googlegroups.com
HI

Your example is working when I test it. I also found the problem with my own example. I hade used api_service.access_token_put instead of api_service.access_token_get .

Regards

Anders


2014-02-06 JV <javier...@gmail.com>:

For more options, visit this group at
http://groups.google.com/group/eiffel-web-framework
 
See the site for the Eiffel-Web-Framework project at
https://github.com/EiffelWebFramework/EWF
---
You received this message because you are subscribed to the Google Groups "Eiffel Web Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eiffel-web-framework+unsubscrib...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

javier hector

unread,
Feb 7, 2014, 6:40:13 AM2/7/14
to eiffel-web...@googlegroups.com
Hi,
I will add the bearer token, thanks for pointing it, at the moment it seems facebook does not require it.

Looking forward to see the new Eiffel API for Facebook :)


/Javier




To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/eiffel-web-framework
 
See the site for the Eiffel-Web-Framework project at
https://github.com/EiffelWebFramework/EWF
---
You received this message because you are subscribed to the Google Groups "Eiffel Web Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eiffel-web-frame...@googlegroups.com.

Anders Persson

unread,
Feb 7, 2014, 8:16:08 AM2/7/14
to eiffel-web...@googlegroups.com
Well, I have at least created a git at github now. I called it eiface and I suppose you can see it. Then when you think it should be part of EWF I assumed that is possible.

Regards

Anders


2014-02-06 JV <javier...@gmail.com>:
eiffel-web...@googlegroups.com
To unsubscribe from this group, send email to
eiffel-web-framework+unsubscrib...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/eiffel-web-framework
 
See the site for the Eiffel-Web-Framework project at
https://github.com/EiffelWebFramework/EWF
---
You received this message because you are subscribed to the Google Groups "Eiffel Web Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eiffel-web-framework+unsubscrib...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
--
You received this message because you are subscribed to the Google
Groups "Eiffel Web Framework" group.
 
To post to this group, send email to
eiffel-web...@googlegroups.com
To unsubscribe from this group, send email to
eiffel-web-framework+unsubscrib...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/eiffel-web-framework
 
See the site for the Eiffel-Web-Framework project at
https://github.com/EiffelWebFramework/EWF
---
You received this message because you are subscribed to the Google Groups "Eiffel Web Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eiffel-web-framework+unsubscrib...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
--
You received this message because you are subscribed to the Google
Groups "Eiffel Web Framework" group.
 
To post to this group, send email to
eiffel-web...@googlegroups.com
To unsubscribe from this group, send email to

Anders Persson

unread,
Feb 9, 2014, 7:11:25 AM2/9/14
to eiffel-web...@googlegroups.com
Hi

I have now added some initial code at github. Next step for me will be to use it in a simple web-application to verify it further. I will add new code to eiface when necessary for my web-apploication implementatoin..

Some parts of the code is identical to the eisaana code and it might be interesting to move these parts to a common libaray.

Regards

Anders

Jocelyn Fiat

unread,
Feb 10, 2014, 4:09:15 AM2/10/14
to eiffel-web-framework
Hi Anders,

I haven't checked it yet, but I am sure Javier will do (or has already done).
In any case, as you suggested, a next step for "cypress" and "EWF" project, is to analyze different Eiffel API using cypress, and build a common library to ease implementation of such Eiffel web api wrapper.

Javier is likely to coordinate this effort, then we'll be able to wrap other web api in an easier and efficient manner.

Thanks for this initial contribution,
-- Jocelyn




For more options, visit this group at
http://groups.google.com/group/eiffel-web-framework
 
See the site for the Eiffel-Web-Framework project at
https://github.com/EiffelWebFramework/EWF
---
You received this message because you are subscribed to the Google Groups "Eiffel Web Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eiffel-web-frame...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.



--
Jocelyn
------------------------------------------------------------------------
Eiffel Software
805-685-1006
http://www.eiffel.com
Customer support: http://support.eiffel.com
User group: http://groups.eiffel.com/join
------------------------------------------------------------------------

javier hector

unread,
Feb 10, 2014, 6:22:11 AM2/10/14
to eiffel-web...@googlegroups.com
Hi Anders

Great,
I will take a look today, just a note about the library structure. I think we need to define a common directory structure, We have been using the following layout.

eiface
        - doc  
        - src or library
        - test or testing
        - examples
         Readme.md

/Javier

Anders Persson

unread,
Aug 22, 2018, 3:08:56 AM8/22/18
to Eiffel Web Framework
Hi

Is this still the latest regarding integration with Facebook, google etc authentication that is done with Eiffel? 

I just would like to protect a page with a simple login solution.

Anders

JV

unread,
Aug 23, 2018, 7:45:39 AM8/23/18
to Eiffel Web Framework
Hi Anders, for Authentication using OAuth you can use Cypress library.
We have now <<login_with>> cluster that has a list of supported integrations you can include all or only one if needed.
For an example of use check the following login with github example, at the moment the example is not in the master branch

Let me know if that helps.
/Javier

Anders Persson

unread,
Aug 24, 2018, 1:46:21 AM8/24/18
to eiffel-web...@googlegroups.com
Thanks

I knew I had seen something but could not find it. 

Vänligen

Anders Persson
+46 763 17 23 25



--
--
You received this message because you are subscribed to the Google
Groups "Eiffel Web Framework" group.
 
To post to this group, send email to
eiffel-web...@googlegroups.com
To unsubscribe from this group, send email to
eiffel-web-frame...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/eiffel-web-framework
 
See the site for the Eiffel-Web-Framework project at
https://github.com/EiffelWebFramework/EWF
---
You received this message because you are subscribed to the Google Groups "Eiffel Web Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eiffel-web-frame...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages