Git Product home page Git Product logo

play-fbconnect's People

Contributors

johannesfritsch avatar mmurray avatar regisbamba avatar stefanwayon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

play-fbconnect's Issues

Exception in FBConnect callback.

I am having a problem connecting to Facebook because my client_secret parameter contains a pipe character (|). The line
String response = WS.url(authUrl).get().getString();
generates an exception

Execution exception (In {module:fbconnect-0.1}/app/controllers/FBConnect.java around line 27)
RuntimeException occured : java.lang.IllegalArgumentException

play.exceptions.JavaExecutionException: java.lang.IllegalArgumentException
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:285)
at Invocation.HTTP Request(Play!)
Caused by: java.lang.RuntimeException: java.lang.IllegalArgumentException
at play.libs.ws.WSAsync$WSAsyncRequest.get(WSAsync.java:109)
at controllers.FBConnect.callback(FBConnect.java:36)
at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:408)
at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:403)
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:176)
... 1 more
Caused by: java.lang.IllegalArgumentException
at java.net.URI.create(URI.java:842)
at com.ning.http.client.RequestBuilderBase.buildUrl(RequestBuilderBase.java:265)
at com.ning.http.client.RequestBuilderBase.setUrl(RequestBuilderBase.java:260)
at com.ning.http.client.AsyncHttpClient$BoundRequestBuilder.setUrl(AsyncHttpClient.java:327)
at com.ning.http.client.AsyncHttpClient.requestBuilder(AsyncHttpClient.java:488)
at com.ning.http.client.AsyncHttpClient.prepareGet(AsyncHttpClient.java:383)
at play.libs.ws.WSAsync$WSAsyncRequest.get(WSAsync.java:106)
... 5 more
Caused by: java.net.URISyntaxException: Illegal character in query at index 236: https://graph.facebook.com/oauth/access_token?client_id=0000000000000000&redirect_uri=http://127.0.0.1:9000/fbconnect/oauth/callback&client_secret=6c4ab332d2ffa800659c934489a6cb04&code=2.dfsfd6dfdsfqJ4K7eRAH6SQtBw__.3600.1290690000-636994782|k1Mm5krKf8as87-0a3uaq4cZxR0
at java.net.URI$Parser.fail(URI.java:2809)
at java.net.URI$Parser.checkChars(URI.java:2982)
at java.net.URI$Parser.parseHierarchical(URI.java:3072)
at java.net.URI$Parser.parse(URI.java:3014)
at java.net.URI.(URI.java:578)
at java.net.URI.create(URI.java:840)
... 11 more

Lack of "expires" parameter

If facebook applications with offline_access permissions get allowed, they don't return expires parameter and this plugin throws the following error

Unexpected error : Module fbconnect could not find access token and expires in facebook callback

other problem is callback method is called back with the following URL FBConnect.java and it does not have expires. Maybe Facebook changed something?

http://localhost:9000/fbconnect/oauth/callback?code=AQDZXiYDxxxxxxxxxxxxxxxxxxxxxxxxxMWe1VB7c#_=_

Please confirm.

NullPointer exception when running functional tests in console

Version: fbconnect-head

play auto-test results with:

    Caused by: java.lang.NullPointerException
        at tags.fbconnect.FBConnectTags._button(FBConnectTags.java:26)
        at tags.fbconnect.FBConnectTags$_button.call(Unknown Source)
        at /app/views/Application/displayComix.html.(line:92)

Running test in browser goes smoothly though.

This happens on page which contains fbconnect button.

server response 400

Hi murz,
I had some users getting a 400 error when trying to login using fb. Is it not always happening, can't really figure out what's causing that response but reading around seems that the same redirect uri must be used when getting the oauth dialog and when calling the graph api? Could that be the problem?

This is what the stack trace looks like, any help would be appreciated.

RuntimeException occured : java.io.IOException: Server returned HTTP response code: 400 for URL: https://graph.facebook.com/oauth/access_token?client_id=XXXX&redirect_uri=XXX&client_secret=XXX&code=XXX

Installation error with play install command

I'm trying to install the module on my device. However, it fails for some reason. I'm using play-1.2.3 and using play install fbconnect-0.6.

$ play install fbconnect-0.6
~        _            _ 
~  _ __ | | __ _ _  _| |
~ | '_ \| |/ _' | || |_|
~ |  __/|_|\____|\__ (_)
~ |_|            |__/   
~
~ play! 1.2.3, http://www.playframework.org
~
~ Will install fbconnect-0.6
~ This module is compatible with: 1.2
~ Do you want to install this version (y/n)? y
~ Installing module fbconnect-0.6...
~
~ Fetching http://www.playframework.org/modules/fbconnect-0.6.zip
~ [--------------------------100%-------------------------] 33229.5 KiB/s   
~ Unzipping...
Traceback (most recent call last):
  File "/Users/alp/play-1.2.3/play", line 153, in <module>
    status = cmdloader.commands[play_command].execute(command=play_command, app=play_app, args=remaining_args, env=play_env, cmdloader=cmdloader)
  File "/Users/alp/play-1.2.3/framework/pym/play/commands/modulesrepo.py", line 58, in execute
    install(app, args, env)
  File "/Users/alp/play-1.2.3/framework/pym/play/commands/modulesrepo.py", line 391, in install
    Unzip().extract(archive, os.path.join(env["basedir"], 'modules/%s-%s' % (module, v['version'])))
  File "/Users/alp/play-1.2.3/framework/pym/play/commands/modulesrepo.py", line 152, in extract
    outfile = open(os.path.join(dir, name), 'wb')
IOError: [Errno 13] Permission denied: '/app/controllers/FBConnect.java'

Then I try it with sudo.

$ sudo play install fbconnect-0.6
~        _            _ 
~  _ __ | | __ _ _  _| |
~ | '_ \| |/ _' | || |_|
~ |  __/|_|\____|\__ (_)
~ |_|            |__/   
~
~ play! 1.2.3, http://www.playframework.org
~
~ Will install fbconnect-0.6
~ This module is compatible with: 1.2
~ Do you want to install this version (y/n)? y
~ Installing module fbconnect-0.6...
~
~ Fetching http://www.playframework.org/modules/fbconnect-0.6.zip
~ [--------------------------100%-------------------------] 25840.4 KiB/s   
~ Unzipping...
~
~ Module fbconnect-0.6 is installed!
~ You can now use it by adding it to the dependencies.yml file:
~
~ require:
~     play -> fbconnect 0.6

However after navigating to the folder using

$ cd fbconnect-0.6

only the following files are installed:

README.md build.xml manifest

what can be the problem?

Not compatible with Play 1.2.2

@673lhjoh8
Cannot start in PROD mode with errors

Compilation error (In {module:fbconnect-0.5}/app/controllers/FBConnect.java around line 39)
The file {module:fbconnect-0.5}/app/controllers/FBConnect.java could not be compiled. Error raised is : The method newRequest(String, String) in the type WSUrlFetch is not applicable for the arguments (String)

play.exceptions.CompilationException: The method newRequest(String, String) in the type WSUrlFetch is not applicable for the arguments (String)
at play.classloading.ApplicationCompiler$2.acceptResult(ApplicationCompiler.java:246)
at org.eclipse.jdt.internal.compiler.Compiler.handleInternalException(Compiler.java:672)
at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:516)
at play.classloading.ApplicationCompiler.compile(ApplicationCompiler.java:278)
at play.classloading.ApplicationClassloader.getAllClasses(ApplicationClassloader.java:412)
at play.Play.preCompile(Play.java:563)
at play.Play.init(Play.java:291)
at play.server.Server.main(Server.java:158)
~
~ Precompilation has failed, stop deploying.
~

Unable to get the access_token parameter from facebook graph api

With the version you last pushed to master, is impossible to get the access_token parameter returned by facebook.
Here the patch i wrote in the file FBConnect.java

import com.google.gson.JsonPrimitive;
JsonObject jsonData = WS.url(uri).get().getJson().getAsJsonObject();
jsonData.add("accessToken", new JsonPrimitive(accessToken));

and thats it!!!! now i have access to allData from the user authenticated.!!

I hope you include this on your project. Its very simple and we get so much!!

findForFacebookOAuth method mentioned, not exists

When my application tries to authenticate to Facebook, code throws an InvocationTargetException at FBConnect.java and code steps into

[...]
}catch(InvocationTargetException e){
                throw new UnexpectedException("Module fbconnect encountered an error while calling your model's findForFacebookOAuth: "+e.getMessage());
}

and throws the exception. (Interestingly, e.getMessage() is null at this point. Maybe that InvTargetExceptn does not have a message?)

Then I found out that the method name findForFacebookOAuth (mentioned in exception) does not exist in the code at all (I grepped) and probably it is facebookOAuthCallback that you mentioned in line

Method method = model.getMethod("facebookOAuthCallback", new Class[] { JsonObject.class });

Interestingly I have a method in the User model class that I configured that matches what the plugin requires.

public static void facebookOAuthCallback(JsonObject data)

However I still get that exception. A bug?

IllegalStateException: This is not a JSON Object.

Hi!

I sometimes have this exception in my code, it really depends (that's gonna be hard to explain how to reproduce it :s).

Here the stack:

play.exceptions.JavaExecutionException: This is not a JSON Object.
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:231)
at play.server.PlayHandler$NettyInvocation.execute(PlayHandler.java:257)
at play.Invoker$Invocation.run(Invoker.java:278)
at play.server.PlayHandler$NettyInvocation.run(PlayHandler.java:235)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalStateException: This is not a JSON Object.
at com.google.gson.JsonElement.getAsJsonObject(JsonElement.java:83)
at controllers.FBConnect.callback(FBConnect.java:62)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at play.mvc.ActionInvoker.invokeWithContinuation(ActionInvoker.java:551)
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:502)
at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:478)
at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:473)
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:161)
... 11 more

I guess adding a try/catch where you try to parse the JSON response from Facebook should fix this problem. maybe.
(sorry I'm not for more help on it!)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.