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

iOS Authentication Issues #24

Closed
ddutchie opened this issue Aug 31, 2018 · 13 comments
Closed

iOS Authentication Issues #24

ddutchie opened this issue Aug 31, 2018 · 13 comments

Comments

@ddutchie
Copy link

Hello Elringus.

I am getting this error when running on iOS.

UnityGoogleDrive: Failed to execute authorization procedure. Check application settings and credentials. UnityGoogleDrive.AuthController:HandleAccessTokenProviderDone(IAccessTokenProvider) UnityEngine.AsyncOperation:InvokeCompletionEvent()

Settings are correct as it is working on Android.
Any ideas?

@ddutchie
Copy link
Author

Problem seems to be here

c940613#diff-059ca10b396f826e0aaedf1b9ee4ff20

When changing it to

httpListener.BeginGetContext(HandleHttpListenerCallback, httpListener);

The webpage does not present the response, but the app finishes the request.

@elringus
Copy link
Owner

As far as I remember, iOS issues were due to using a blocking http listener. I've just made a commit, that will allow to use an async listener on iOS, but will still block on Android. Can you please check whether it will solve the issue?

@ddutchie
Copy link
Author

Thanks!

The browser does not present the loopback response HTML, but the app finishes the request.

@elringus
Copy link
Owner

elringus commented Sep 9, 2018

I've published a new release with the fixes for both Android and iOS authentication issues. Please refer to the project's readme to find out how to configure the plugin to work on these platforms.

@elringus elringus closed this as completed Sep 9, 2018
@ddutchie
Copy link
Author

Great, Thanks!

The only issue I am facing is that my bundle id for my app contains some Capital letters. As this app is already published there is no way to correct this. Is there a workaround so it could still work?

@elringus
Copy link
Owner

For iOS it should be enough to set the lower-cased app id to Supported URL Schemes in the player settings. For Android you'll have to modify the AndroidManifest.xml at UnityGoogleDrive/Plugins/com.elringus.unitygoogledriveandroid.aar (unzip it) /AndroidManifest.xml and replace ${applicationId} with the lower cased app id.

@ddutchie
Copy link
Author

Great. I'll try that. Thanks again

@ddutchie
Copy link
Author

It does not seem to work.

I have tried setting Supported URL Schemes to lowercase.

I also tried setting OAuth client Bundle ID to lowercase. Does not seem to authenticate if the original Bundle ID for the app has any capital letters.

@elringus
Copy link
Owner

Can you please verify that it's working when you set original bundle id to lowercase (just to be sure that the issue is not with something else).

@ddutchie
Copy link
Author

it is, as soon as bundle Id is lowercase it works.

@elringus
Copy link
Owner

Ok, thanks for checking. I've created a new issue (#27) and will try to remove that requirement for the app id to be lowercased.

@elringus
Copy link
Owner

I think I've actually found a temporary workaround for this. I've changed the requested redirect URI so that it will always use lower-cased app id and now the trick with adding lower-cased app id to the Supported URL Schemes list should work (it did in my test project, at least).

@ddutchie
Copy link
Author

Great, that works!!
Good job.

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