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

Getting an error when trying to connect via Facebook #7

Closed
parkej60 opened this issue Nov 15, 2013 · 13 comments
Closed

Getting an error when trying to connect via Facebook #7

parkej60 opened this issue Nov 15, 2013 · 13 comments

Comments

@parkej60
Copy link

screen shot 2013-11-15 at 10 36 21 am

@woloski
Copy link

woloski commented Nov 15, 2013

James,

Matias here, from Auth0. We'll look into this.

In the meantime, can you do a quick test? In Auth0Client.m there is a parameter sent to our API: scope=openid%%20profile (https://github.com/auth0/Auth0.iOS/blob/master/Auth0Client/Auth0Client.m#L21). Can you try removing the %%20profile? I think this probably has to do with Facebook returning a big profile and the token we generate is too large. Let's try that.

@parkej60
Copy link
Author

That seems to have removed the error. Does this mean that the profile information won't be returned at all now?

@woloski
Copy link

woloski commented Nov 15, 2013

No, we can use the API (/userinfo endpoint) to retrieve the user profile instead of getting it back in the token.

BTW, other customers deleted some of the attributes coming from Facebook that weren't useful in their scenario by using a rule in Auth0.

@woloski
Copy link

woloski commented Nov 15, 2013

@parkej60 we updated the library to use the /userinfo endpoint. Let us know if you find any other issue.

Thanks for all the feedback!

@parkej60
Copy link
Author

This is an unrelated error, but I'm having issues with the block calls withing the webview delegate method. It needs a bool returned and it seems to not call any code that follows the block call within it. I'm wondering if it has something to do with your files be non-arc. I'll continue to troubleshoot it and let you know what I find, but if you have any insight please let me know.

@woloski
Copy link

woloski commented Nov 15, 2013

We added a sample as well (https://github.com/auth0/Auth0.iOS/tree/master/Auth0Client.Sample). If you try that, do you get any errors/issues?

@parkej60
Copy link
Author

I'm now getting this error.

* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -length only defined for abstract class. Define -[Auth0User length]!'
*** First throw call stack:
(
0 CoreFoundation 0x04c275e4 exceptionPreprocess + 180
1 libobjc.A.dylib 0x03d928b6 objc_exception_throw + 44
2 CoreFoundation 0x04c273bb +[NSException raise:format:] + 139
3 Foundation 0x038616eb NSRequestConcreteImplementation + 218
4 Foundation 0x0382ae80 -[NSData(NSData) length] + 48
5 Foundation 0x03776bff -[NSData(NSData) description] + 56
6 Foundation 0x037a2785 _NSDescriptionWithLocaleFunc + 93
7 CoreFoundation 0x04ba5dc6 __CFStringAppendFormatCore + 8550
8 CoreFoundation 0x04be6944 _CFStringCreateWithFormatAndArgumentsAux + 116
9 CoreFoundation 0x04c4cdd6 _CFLogvEx + 118
10 Foundation 0x037d7fbc NSLogv + 137
11 Foundation 0x037d7f28 NSLog + 27
12 Echo 0x00102dd6 __36-[Auth0ViewController didClickLogIn]_block_invoke + 134
13 Echo 0x0010646b __59-[Auth0Client loginAsync:connection:withCompletionHandler:]_block_invoke + 75
14 Echo 0x00105ff3 __54-[Auth0Client getAuthenticator:withCompletionHandler:]_block_invoke_2 + 451
15 Echo 0x0010703d __49-[Auth0Client getUserInfo:withCompletionHandler:]_block_invoke + 205
16 Foundation 0x038a1695 __67+[NSURLConnection sendAsynchronousRequest:queue:completionHandler:]_block_invoke_2 + 151
17 Foundation 0x03801945 -[NSBlockOperation main] + 88
18 Foundation 0x0385a829 -[__NSOperationInternal _start:] + 671
19 Foundation 0x037d7558 -[NSOperation start] + 83
20 Foundation 0x0385caf4 __NSOQSchedule_f + 62
21 libdispatch.dylib 0x040174b0 _dispatch_client_callout + 14
22 libdispatch.dylib 0x0400575e _dispatch_main_queue_callback_4CF + 340
23 CoreFoundation 0x04c8ca5e __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE
+ 14
24 CoreFoundation 0x04bcd6bb __CFRunLoopRun + 1963
25 CoreFoundation 0x04bccac3 CFRunLoopRunSpecific + 467
26 CoreFoundation 0x04bcc8db CFRunLoopRunInMode + 123
27 GraphicsServices 0x049f79e2 GSEventRunModal + 192
28 GraphicsServices 0x049f7809 GSEventRun + 104
29 UIKit 0x026c8d3b UIApplicationMain + 1225
30 Echo 0x000748dd main + 141
31 libdyld.dylib 0x042a970d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

@woloski
Copy link

woloski commented Nov 18, 2013

Hi James, where are you getting that? I just tried the sample on ios7 emulator and it worked fine.
By the way, we are on the chat http://chat.auth0.com if you want to connect there.

@parkej60
Copy link
Author

I still get the Facebook error message that I originally posted when using your example app. Also it appears that your example application is using the compiled library? Is that what I'm supposed to be using or should I just be using the class files?

@woloski
Copy link

woloski commented Nov 18, 2013

Yes. I've got that error as well the first time you log-in with Facebook. It's an alert view that is shown when there is a URL that can't be resolved. We are removing that alert and just leaving the NSLog. Also, the sample was pointing to the library, as you mentioned, we are changing it to point straight to the src code.

Apologies for all the back and forth with this. Although these SDKs are open source so anyone can fix things, we are responsible for them and want them to be straight forward, otherwise it gets frustrating as a developer. So thanks for helping us making this SDK more robust for the next dev 😃

@parkej60
Copy link
Author

Thanks, I appreciate your quick responses as well. It definitely makes it easier and more reassuring.

@parkej60
Copy link
Author

Oh, when you're fixing the sample project you probably want to pull out all non-relative path references as well. I had to remove one that was referring to your devs local machine.

@woloski
Copy link

woloski commented Nov 18, 2013

yep, saw that :)

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

3 participants